assert


Adds diagnostic features to the program.

[Classification]

Standard library

[Syntax]

#include <asssert.h>

void assert(int expression);

[Description]

Adds diagnostic features to the program.

If expression is true, ends processing without returning a value. If expression is false, it outputs diagnostic information to the standard error file in the format defined by the compiler, and then calls the abort function.

The diagnostic information includes the program text of the parameters, the name of the source file, and the line number of the source.

 

If you wish to disable the assert macro, include a #define NDEBUG statement before assert.h is loaded.