C++内存泄漏及检测工具详解

#include "stdafx.h"
#ifdef _DEBUG
#define DEBUG_CLIENTBLOCK   new( _CLIENT_BLOCK, __FILE__, __LINE__)
#else
#define DEBUG_CLIENTBLOCK
#endif
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#ifdef _DEBUG
#define new DEBUG_CLIENTBLOCK
#endif
int _tmain(int argc, _TCHAR* argv[])
{
	int* p = new int();
	_CrtDumpMemoryLeaks();
	return 0;
}
原文地址:https://www.cnblogs.com/chunyou128/p/4322430.html