Same level pages:
<algorithms> <cassert> <cerrno> <cctype> <cfloat> <climits> <clocale> <cmath> <complex> <csetjmp> <csignal> <cstdarg> <cstddef> <cstdio> <cstdlib> <cstring> <ctime> <cwchar> <cwctype> <exception> <fstream> <functional> <iomanip> <ios> <iostream> <istream> <iterator> <limits> <locale> <memory> <new> <numeric> <ostream> <sstream> <stdexcept> <streambuf> <string> <typeinfo> <utility> <valarray>
Parent level pages:
STL FAQs Headers Libraries
| | <cassert>
is part of the diagnostics library.
Macros
assert ( expression )
- If expression is false , assert() prints something like:
Assertion failed: expression, file xyz, line nnn
on the standard error output and aborts. In the error message, xyz is the name of the source file and nnn the source
line number of the assert() statement. The latter are respectively the values of the
preprocessor macros __FILE__ and __LINE__.
- Compiling with the macro NDEBUG defined ahead of the #include <assert> statement, will stop
assertions from being compiled into the program.
|