读书人

assert有关问题 求详解 谢过

发布时间: 2012-03-14 12:01:13 作者: rapoo

assert问题 求详解 谢过
#include <cassert>
using namespace std;

#ifdef NDEBUG
#define assert(cond) ((void)0)
#else
void assertImpl(const char*, const char*, long);
#define assert(cond) ((cond) ? (void)0 : assertImpl(?,?,?))
#endif

int main(int argc,char* args[]){
int i=3;
assert(i == 3);//这里怎么提示里面要输入个表达式呀
return 0;
}

[解决办法]
assert
Evaluates an expression and when the result is FALSE, prints a diagnostic message and aborts the program.

[解决办法]
http://topic.csdn.net/u/20111104/12/c18e3061-2246-48a7-b127-6bcb966c11b7.html

读书人网 >C++

热点推荐