Programming Tutorials

Comment on Tutorial - assert() example program in C++ By Charles



Comment Added by : Ryba

Comment Added at : 2010-05-19 15:45:48

Comment on Tutorial : assert() example program in C++ By Charles
it should be:
/* --------------- */
#define ASSERT(x)
if (x) {} \
else { \
//.. bla bla bla
debugBreak();
}
/* ---------------- */

Gues what happen if u use ur version like that:
if (x < 3)
ASSERT(x >= 0);
else
doSomeStuff();

;]


View Tutorial