53.9k views
1 vote
To help prevent memory leaks from occurring in c++ 11, a ________ automatically deletes a chunk of dynamically allocated memory when the memory is no longer being used.

User David Lin
by
8.3k points

1 Answer

6 votes
The answer is smart pointers. Smart pointers are wrappers for raw pointers or as I like to call them dumb pointers.

In C++, it is guaranteed that the deconstructor will be called when the object goes out of scope.
User Istruble
by
8.3k points