Prints a diagnostic message and aborts the calling thread.
#include <assert.h> #include <stdio.h> void assert (int expression);
expression
Use the assert macro in program development to identify program logic errors. Choose expression so that it holds true only if the program is operating as intended.
After debugging a program, remove assert calls from the program using the special identifier NDEBUG. If NDEBUG is defined by any value with a /D command-line option or with a #define directive, the C preprocessor removes all assert calls from the program source.
The diagnostic message has this form:
Assertion failed: expression, file filename, line linenumber
Where:
filename |
The source file's name. |
linenumber |
Line number of the assertion that failed in the source file. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/assert.h | assert.h stdio.h |
clib.lib |