Releasing Dynamically Allocated Memory
Any memory dynamically allocated with new must be released with delete. The delete operator can be used in two ways: one for de-allocating memory allocated to arrays with new and the other for deleting single objects.
Note that the compiler is not required to generate a diagnostic message for using the wrong delete. Furthermore, using the inappropriate deallocator will result in undefined behavior.
Read more about this topic: New (C++)
Famous quotes containing the word memory:
“The struggle of man against power is the struggle of memory against forgetting.”
—Milan Kundera (b. 1929)