← Quiz: Exception Handling in C++: all 10 questions
Quiz: Exception Handling in C++ · Question 9 of 10
What happens if an exception escapes a function marked noexcept?
What happens if an exception escapes a function marked noexcept?
- A.The exception is ignored
- B.It is converted to a return value of -1
- C.std::terminate is called and the program stops
- D.The compiler reports an error
Answer & explanation
Correct answer: std::terminate is called and the program stops
noexcept is a promise; breaking it at run time ends the program.
Can you get the rest right without peeking?
Take the timed Quiz: Exception Handling in C++ quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →