C Standard Library - <assert.h>
Introduction
The assert.h header file of the C standard library provides a macro named assert, which can be used to verify that the program makes assumptions and prints a diagnostic message if the assumption is false.
The defined macro assert points to another macro NDEBUG, which is not part of <assert.h>. If NDEBUG has been defined as the macro name in the source file that references <assert.h>, then the assert macro is defined as follows: #define assert(ignore) ((void)0)
Library macro
The following columns The only function defined in the header file assert.h is:
Function & Description | |
---|---|
void assert(int expression) | This is actually a macro, not a function, and can be used to add diagnostics to C programs.