您的位置:首页 > 编程语言 > C语言/C++

Windows C/C++ 内存泄露检测

2013-12-16 11:14 281 查看
#pragma once
#define _CRTDBG_MAP_ALLOC

#include<crtdbg.h>
#include<stdlib.h>
#include<locale.h>
#include <iostream>
#include<fstream>
#include <list>
#include <string>
#include <map>

#ifdef _DEBUG
#ifndef DBG_NEW
#define DBG_NEW new(_NORMAL_BLOCK,__FILE__,__LINE__)
#define new DBG_NEW
#endif
#endif

注意:DBG_NEW 的位置要放在stream和string的后面,否则会有冲突。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: