Intermediate C++
Q42 / 100

What is a smart pointer?

Correct! Well done.

Incorrect.

The correct answer is B) An object that acts like a pointer but manages the lifetime of the pointed-to object automatically

B

Correct Answer

An object that acts like a pointer but manages the lifetime of the pointed-to object automatically

Explanation

Smart pointers (unique_ptr, shared_ptr, weak_ptr) use RAII to automatically delete objects when no longer needed, preventing memory leaks.

Progress
42/100