Search code examples
c++memoryheap-memoryallocationdelete-operator

C++ delete [] - how to check if "all is deleted"?


I was wondering, throughout a program I am using a lot of char* pointers to cstrings, and other pointers. I want to make sure that I have delete all pointers after the program is done, even though Visual Studio and Code Blocks both do it for me (I think..).

Is there a way to check is all memory is cleared? That nothing is still 'using memory'?


Solution

  • The obvious answer on Linux would be valgrind, but the VS mention makes me think you're on Windows. Here is a SO thread discussing valgrind alternatives for windows.