🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Exception Handling in C++: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. When a throw statement runs inside a try block, what happens to the remaining statements in that try block?
  2. Q2. What does this print? (code)
  3. Q3. Why should you catch exceptions by const reference?
  4. Q4. What is stack unwinding?
  5. Q5. What does this print? (code)
  6. Q6. Which catch block order is correct?
  7. Q7. What is the best base class for your own InsufficientFunds exception?
  8. Q8. Inside a catch block, what is the difference between throw; and throw e; (where e is const exception &)?
  9. Q9. What happens if an exception escapes a function marked noexcept?
  10. Q10. Why should a destructor never throw an exception?