ASSERT-C ++编译错误

时间:2011-04-26 11:33:51

标签: c++ compiler-errors

#include "stdafx.h"
#include <iostream>
#include <assert.h>

using namespace std;

class A
{
public:
    int IsLocked();
};
int A::IsLocked()
{
    return false;
}

int main()
{
    A a1;
    ASSERT(a1.IsLocked());
    return 0;
}

因未找到断言标识符而收到错误....我试过也包括..

1 个答案:

答案 0 :(得分:7)

应该是:

assert(a1.IsLocked())

注意小写。