🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.The exception is ignored
  2. B.It is converted to a return value of -1
  3. C.std::terminate is called and the program stops
  4. 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 →