← 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?
- A.Freeing all heap memory when the program ends
- B.Printing the call stack when the program crashes
- C.Leaving each function between throw and catch, destroying its local objects with their destructors
- 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 →