What happens if no matching catch handler is found for a thrown exception?

Options

  • A. The exception is automatically converted into zero.
  • B. The program continues normally without handling the exception.
  • C. The program terminates through the standard unhandled-exception mechanism.
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. The program terminates through the standard unhandled-exception mechanism.

Detailed Explanation

Answer: (C) The program terminates through the standard unhandled-exception mechanism.

If an exception is thrown and no appropriate handler is found, the exception remains unhandled.

For an exception that escapes the relevant handling mechanism, C++ invokes std::terminate(), which normally results in program termination.

Therefore, an unhandled exception does not simply get converted to zero or allow the program to continue normally.