Write the necessary preprocessor directive to enable the use of the exit function. Write the definition of a function named panic. The function prints the message “unrecoverable error” and then terminates execution of the program, indicating failure..

1
Write the necessary preprocessor directive to enable the use of the exit function. Write the definition of a function named panic. The function prints the message “unrecoverable error” and then terminates execution of the program, indicating failure..

LANGUAGE: C++

CHALLENGE:

Write the necessary preprocessor directive to enable the use of the exit function. Write the definition of a function named panic. The function prints the message “unrecoverable error” and then terminates execution of the program, indicating failure.

SOLUTION:



void panic(){
   cout << "unrecoverable error" << endl;
 exit (EXIT_FAILURE);
}

One comment

Add comment