How I like to code

Monthly Archives: September 2010

HEAP corruption on PC with const char*

I had a weird thing happen where if I create a TCHAR variable[MAX_PATH] and populate that using any Win32 function, then take that variable and memcpy it into a const char * that has been new’d, I get a HEAP corruption message when I call delete[] on the const char *. Now the funny thing […]