Intermediate
C++
Q41 / 100
What is RAII (Resource Acquisition Is Initialization)?
Correct! Well done.
Incorrect.
The correct answer is B) A C++ idiom where resources are acquired in constructors and released in destructors, tying resource lifetime to object lifetime
B
Correct Answer
A C++ idiom where resources are acquired in constructors and released in destructors, tying resource lifetime to object lifetime
Explanation
RAII ensures resources (memory, files, locks) are released when an object goes out of scope. Smart pointers and std::lock_guard implement RAII.
Progress
41/100