void operator delete(void *p)
{
printf("\nDELETE");
// code to actually delete/free object
}
int _tmain(int argc, _TCHAR* argv[])
{
int *p = new int(10);
delete p;
getchar();
return 0;
}
我收到错误运算符删除已定义
我想全局覆盖 new 和 delete 运算符。