assert()
It it defined in <assert.h> as
#include<assert.h>void assert(int expression)
if expression is false, it print an error message to stderr and stop the program by calling abort. See example as below.
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
int main( void )
{
FILE *fp;
cout << "testing asset" << endl;
assert(true); // true program pass here and below printed
cout << "testing asset true" << endl;
assert(false); // false. Abort raised and program stopped here
cout << "testing asset false" << endl; //never reached here and below
return 0;
}
