C++ Programming/Code/Standard C Library/Functions/assert

< C++ Programming < Code < Standard C Library < Functions
assert
Syntax
#include <cassert>
assert( exp );

The assert() macro is used to test for errors. If exp evaluates to zero, assert() writes information to stderr and exits the program. If the macro NDEBUG is defined, the assert() macros will be ignored.

Related topics
abort
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.