SYNOPSIS: #include void assert(bool expression); DESCRIPTION: This macro is useful for putting diagnostics into programs. When it is executed, if expression is false (zero), assert() prints: execFile: XYZ:NNN: function(): Assertion `expression' failed. on the standard error output and aborts. In the error message, XYZ is the source file name and NNN the source line number of the assert(). Compiling with the C++ (g++ or c++) compiler option -DNDEBUG, or with the preprocessor control statement "#define NDEBUG" ahead of the "#include " statement, stops assertions from being compiled into the program. $ pr -n -t -e4 assertAR.cpp 1 // Sample program to: 2 // 1) Identify if there are nines in an array. 3 // 2) Illustrate use of #define to create constants. 4 // 3) Illustrate use of assert macro to catch bad subscript. 5 // 4) Show array initialization. 6 7 #include 8 #include 9 using namespace std; 10 11 #define ARSIZE 10 12 13 int main() 14 { 15 int i = 0; 16 int Ar[ARSIZE] = {0,1,-1,9,5,9,3,0,545,7}; 17 18 while ( i <= ARSIZE ) 19 { 20 cerr << "Searching Ar[" << i << "] \n"; 21 assert( i