All challenges
Multiple ChoiceBeginner 45s

RAII core idea for exception safety

What is the core idea of RAII (Resource Acquisition Is Initialization)?
Options
  1. 1Bind a resource's lifetime to an object's lifetime so its destructor releases it automatically
  2. 2Acquire all resources in main before any use, then release them explicitly at the end of main
  3. 3Use raw new and delete carefully with manual try/catch blocks around every allocation site
  4. 4Initialize all resources at program startup in a fixed order and free them at program exit

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle