C++: Difference between revisions

No change in size ,  23 October 2019
Line 132: Line 132:


====Deallocate====
====Deallocate====
Normally, containers such as <code>std::vector</code> will automatically deallocate memory from the heap when the destructor is called. However, occationally you may want to coarse this deallocation yourself.<br>
Normally, containers such as <code>std::vector</code> will automatically deallocate memory from the heap when the destructor is called. However, occationally you may want to coerse this deallocation yourself.<br>
There are a few ways to do this:
There are a few ways to do this:
* Use smart pointers
* Use smart pointers