Programming Tips - Borland C++: My heap is being corrupted somehow, how can I locate where?

Date: 2010apr21 Product: Borland C++ 5.x Keywords: obsolete, malloc, free Language: C/C++ Q. Borland C++: My heap is being corrupted somehow, how can I locate where? A. Sprinkle calls to heapcheck() around your code to narrow down the location. Example from the help file:
#include <malloc.h> if (heapcheck() == _HEAPCORRUPT) { printf("Heap is corrupted.\n"); } else { printf("Heap is OK.\n"); }
There is also a _heapchk() function.