????C++???????????????????????????????????????????С?????й???????????????????檔
????????????????debug???2??????й????????
???????????????????????????д?????????:
????1 #define _CRTDBG_MAP_ALLOC
????2 #include <crtdbg.h>
????3 #include <stdlib.h>
??????1?ж??????????Щ?????亯????debug???????
??????<crtdbg.h>???????????????δ???
????C++?????й????1 #define NEW_WITH_MEMORY_LEAK_CHECKING new(_NORMAL_BLOCK??__FILE__??__LINE__) 2 #define new NEW_WITH_MEMORY_LEAK_CHECKING
????????new???????VC++??operator new????????????????<vcruntime_new_debug.h>????????????????
????????????????????????new??delete?????????VC++???????????????????????
????1 _CrtDumpMemoryLeaks();
???????????“???”????????????
???????????
????1 #define _CRTDBG_MAP_ALLOC
????2 #include <stdlib.h>
????3 #include <crtdbg.h>
????4 #define NEW_WITH_MEMORY_LEAK_CHECKING new(_NORMAL_BLOCK??__FILE__??__LINE__)
????5 #define new    NEW_WITH_MEMORY_LEAK_CHECKING
????6
????7 int main()
????8 {
????9     auto p = new int[10];
????10     _CrtDumpMemoryLeaks();
????11     return 0;
????12 }
????C++?????й????1 #pragma push_macro("new") 2 #undef new 3 //using the raw new 4 #pragma pop_macro("new")
????#pragma push/pop_macro?????????/??????????????new???????????????壬?????????壬????????new????????????????塣