Computer Science A - assert() - 2/29/00 #include assert - An errer checking function that when called consists of the assert identifier, a logical expression, followed by a semi-colon. If the logical expression is false, then the program will end & an error message issued. If the logical expression is true, nothing happens and the program proceeds to the next statement. Example: if(infile.fail()) { cout<<"Input file did not open\n"; exit(); } This checks to see if an input file did open. Or: assert(!infile.fail()) This will accomplish the same. We are asserting that the file opening did not fail.