对于c++的内存泄露检测,除了我们自己手动检查以外,还可以使用c++中的函数来帮助我们检测,
如下代码:
#include stdafx.h
#include <string>
#include<iostream>
#include <crtdbg>
using namespace std;
int main()
{
char *p=new char[10];
//char *pp=new char[100];
delete p;
_CrtDumpMemoryLeaks();
//cout<<p<<endl;
return 0;
}
调试的时候按