🎙 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 4 of 10

What is stack unwinding?

What is stack unwinding?

  1. A.Freeing all heap memory when the program ends
  2. B.Printing the call stack when the program crashes
  3. C.Leaving each function between throw and catch, destroying its local objects with their destructors
  4. D.Undoing the changes made inside the try block
Answer & explanation

Correct answer: Leaving each function between throw and catch, destroying its local objects with their destructors

Local objects are destroyed in reverse order of creation as each function is exited.

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 →