#include <crtdbg.h>
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
void EnableMemLeakCheck() //用于检测是否有内存泄漏。
{
{
EnableMemLeakCheck();
int *leak = new int[10];
}
Loaded 'C:\WINNT\system32\kernel32.dll', no matching symbolic information found.
Detected memory leaks!
Dumping objects ->
D:\DS_Learn\meleak\test1.cpp(19) : {39} normal block at 0x00430120, 40 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
The thread 0x91C has exited with code 4391200 (0x430120).
The program 'D:\DS_LEARN\meleak\Debug\meleak.exe' has exited with code 4391200 (0x430120).