Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Keyword to release dynamically allocated memory (allocated by the keyword new).
MyClass * myClass = new MyClass;
//Do stuff on myClass
delete myClass;
Prefer to use smart pointers [1] . If you do so, you rarely ever need to use delete.
Be aware that it is valid to delete a pointer-to-const.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.