← Quiz: Memory and Smart Pointers: all 10 questions
Quiz: Memory and Smart Pointers · Question 4 of 10
What does RAII guarantee?
What does RAII guarantee?
- A.Faster code
- B.Resources are released automatically when the owning object is destroyed
- C.No exceptions are thrown
- D.Objects are never copied
Answer & explanation
Correct answer: Resources are released automatically when the owning object is destroyed
Cleanup lives in destructors, which always run when the object's scope ends.
Can you get the rest right without peeking?
Take the timed Quiz: Memory and Smart Pointers quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →