Site hosted by Angelfire.com: Build your free website today!

Table of Contents Previous Next


1.1 The Standard Headers: <assert.h>

The assert macro is used to add diagnostics to programs.


void assert(int expression)
If expression is zero when
          assert(expression)
is executed, the assert macro will print on stderr a message such as
       Assertion failed: expression, file filename, line nnn
It then calls abort to terminate execution.  The source file name and line number come from the preprocessor macros __FILE__ and __LINE__.

If NDEBUG is defined at the time <assert.h> is included, the assert macro is ignored.


Table of Contents Previous Next


Last modified: Fri Feb 25 13:52:51 2000