Something that I found invaluable when programming C/C++ back in the day was Paul Nettle's memory manager.

Best free code/tool I could use for finding those pesky memory leaks. It's something you really need to start with to save you a world of pain later on...

You can find it here; documentation in the code:

http://www.paulnettle.com/pub/FluidS...emoryManagers/

Happy hacking :-)