The assert macro

Name

assert -- The assert macro

Synopsis

#include <assert.h>

void assert (int expression);

Description

The assert macro puts diagnostics into programs. When it is executed, if expression is false (that is, it compares equal to zero), the assert macro writes information about the particular call that failed (including the text of the argument, the name of the source file, and the source line number–the latter are respectively the values of the preprocessing macros __FILE__ and __LINE__) on the standard error file in an implementation-defined format. It then calls the abort function.

Returns

The assert macro returns no value.

See Also

The abort function

Implementation Notes

The assert macro calls the library function _assert.