if you're using MSVC, you can use the crtdbg library, which has one of my favorite functions, _CrtDumpMemoryLeaks(); That will display all the dynamic memory that is still allocated to the output window whenever you call it. I put it right before main or winmain returns, but you also have to take into account static/global pointers/objects, and local objects in main that have dynamic memory.
However, as the '_' at the front of the function implies, it is an extension. I'm pretty sure it's only for MSVC. To use it, you need to include <stdlib.h> and <crtdbg.h> in that order. It will only work in debug, and doesn't do anything in a release mode, so you won't have to worry about performance hits. The crtdbg library can do lots of other stuff to, but I'll let you fiddle with that on your own.
