VC内存泄露检测

来源:互联网 发布:磁头坏了 数据恢复 编辑:程序博客网 时间:2024/05/16 23:54
#include <iostream>#include <windows.h>#include <crtdbg.h>#include <memory>using namespace std;#ifdef _DEBUG#define new   new(_NORMAL_BLOCK, __FILE__, __LINE__)  #endifint main(void){_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);//_CrtSetBreakAlloc(57);int *p=new int;auto_ptr<int>p (new int);//getchar();return 0;}/*vc++内存泄露检测1.请按F52.在按F4*/


 

0 0
原创粉丝点击