2014年3月30日

VC++使用用crtdbg定位内存泄露错误

摘要: #define _CRTDBG_MAP_ALLOC#ifdef _DEBUG#define new new( _CLIENT_BLOCK, __FILE__, #endif#include #include int main(){ int* p = new int(); _CrtDumpMemoryLeaks(); return 0;}可以【定位】出内存泄露的代码在哪一行!output信息如下:'Test.exe': Loaded 'E:\CODE\Test\Debug\Test.exe', Symbols loaded.'Test.exe': 阅读全文

posted @ 2014-03-30 19:25 Leadtheway 阅读(953) 评论(0) 推荐(0)

导航