A chapter worth reading on InformIT, excerpted from C++ Primer 5th Edition:
Working with Dynamic Memory in C++
by Stan Lippman, Josée Lajoie, Barbara Moo
C++ lets you allocate objects dynamically. The authors of C++ Primer discuss why properly freeing dynamic memory is a rich source of bugs, and how the new library defines smart pointers --
shared_ptr,unique_ptr, andweak_ptr --that make managing dynamic memory much safer.

Add a Comment
Comments are closed.