Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following are two special functions that are meant for handling exception, that occur during exception handling itself ?

  • A.Void terminate ( ) and Void unexpected ( )
  • B.Non void terminate ( ) and void unexpected ( )
  • C.Void terminate ( ) and non void unexpected ( )
  • D.Non void terminate ( ) and non void unexpected ( )

Answer: A

The two special functions that handle exceptions arising during exception handling are terminate() and unexpected(), and both have the return type void. The unexpected() function is called when a function throws an exception that is not in its exception specification, and terminate() is called when no handler is found or when exception handling itself fails.

The options with a non-void version of either function are wrong, since in C++ both are declared as void functions that do not return.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.