I am trying to use _crtBreakAlloc
in the Watch window as suggested in this link, but the value line says that 'identifier "_crtBreakAlloc" is unidentified' and it simply does not work.
What am I doing wrong? I'm using Visual Studio by the way.
An example of code:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include <malloc.h>
int main()
{
int *arr = (int*)malloc(10 * sizeof(int)); //breakpoint here
free(arr);
return 0;
}
I then write _crtBreakAlloc into the Name field of the Watch window and hit enter when encountering the breakpoint.