c++ assert() assertion

**Assertions are macros, not functions. The prototype of **assert macro is defined in <assert.h> (C), (C++), and its function is to terminate the program execution if its condition returns an error. You can turn off assert by defining NDEBUG, but it needs to be at the beginning of the source code and before include <assert.h>.
assert() uses

#define NDEBUG          // 加上这行,则 assert 不可用
#include <assert.h>

assert( p != NULL );    // assert 不可用

Guess you like

Origin blog.csdn.net/it_xiangqiang/article/details/112916485