What happens if an exception is thrown inside a 'catch' block in C++?
A. The exception is automatically caught and handled
B. The program continues normally
C. The program terminates unexpectedly
D. It leads to an infinite loop
Answer: Option C
A. The exception is automatically caught and handled
B. The program continues normally
C. The program terminates unexpectedly
D. It leads to an infinite loop
Answer: Option C
What is exception handling in C++?
A. A method to handle errors during runtime
B. A method to handle errors during compile time
C. A method to handle errors during linking
D. A method to handle errors during execution
What is the purpose of the 'try' block in exception handling in C++?
A. To catch exceptions
B. To throw exceptions
C. To define the block of code that may generate exceptions
D. To handle exceptions
Which of the following is not a standard exception class in C++?
A. IOException
B. std::exception
C. std::runtime_error
D. std::out_of_range
Join The Discussion