Question 2601 – KVS 30-12-2018 Part-A
December 23, 2023Question 13890 – Artificial-Intelligence
December 23, 2023Question 3720 – OOPS
In C++, which system – provided function is called when no handler is provided to deal with an exception?
Correct Answer: A
Question 32 Explanation:
In some cases, the exception handling mechanism fails and a call to void terminate() is made. This terminate() call occurs in any of the following situations:
The exception handling mechanism cannot find a handler for a thrown exception. The following cases are more specific:
1. During stack unwinding, a destructor throws an exception and that exception is not handled.
2. The expression that is thrown also throws an exception, and that exception is not handled.
3. The constructor or destructor of a nonlocal static object throws an exception, and the exception is not handled.
4. A function registered with atexit() throws an exception, and the exception is not handled. The following demonstrates this:
A throw expression without an operand tries to rethrow an exception, and no exception is presently being handled.
The exception handling mechanism cannot find a handler for a thrown exception. The following cases are more specific:
1. During stack unwinding, a destructor throws an exception and that exception is not handled.
2. The expression that is thrown also throws an exception, and that exception is not handled.
3. The constructor or destructor of a nonlocal static object throws an exception, and the exception is not handled.
4. A function registered with atexit() throws an exception, and the exception is not handled. The following demonstrates this:
A throw expression without an operand tries to rethrow an exception, and no exception is presently being handled.
terminate( )
unexpected( )
abort( )
kill( )
Subscribe
Login
0 Comments