InterviewSolution
Saved Bookmarks
| 1. |
Assert( ) Macro... |
|
Answer» Answer :We can use a macro called assert( ) to TEST for conditions that should not occur in a code. This macro expands to an if statement. If test evaluates to 0, assert prints an error message and calls ABORT to abort the program. #INCLUDE #include void main( ) { int i ; cout << "\nEnter an integer: " ; CIN >> i ; assert ( i >= 0 ) ; cout << i << endl ; } |
|