hi all
this is the whole of my program:
#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
void main()
{
char *p=new char[10];
delete[] p;
}
i'm using visual studio .net
when i trace the flow of the program i see that the following override
of operator new in afxmem.cpp is called:
Ln 68: void* __cdecl operator new[](size_t nSize, LPCSTR lpszFileName,
int nLine)
i expect the overriden operator delete[] with the appropriate
prototype is called, that is:
Ln 83: void __cdecl operator delete[](void* pData, LPCSTR /*
lpszFileName */,
int /* nLine */)
but this is not the case. instead, the following operator delete[] is
called:
Ln 377: void __cdecl operator delete[](void* p)
why?