Next Previous Contents

3.19 assert

Function

Test a condition and possibly abort.

Header

assert.h

Declaration

void assert (int cond);

Description

assert is a macro that expands to a id statement. If the condition evaluates t zero (false), assert prints a message on stderr and aborts the program.

Limits

  • The function is actually a macro.

Availability

ISO 9899

See also

abort, exit

Example

None.


Next Previous Contents