使用宏_CRTDBG_MAP_ALLOC 查找程序内存泄露

代码
#include "stdafx.h"
#include 
<iostream>
using namespace std;

#include 
<stdio.h>

#define _CRTDBG_MAP_ALLOC 
#include 
<stdlib.h> 
#include 
<crtdbg.h>

#include 
"windows.h"


int main()
{
    
int *= new int;
    _CrtDumpMemoryLeaks();
    
return 1;
}

Detected memory leaks
!
Dumping objects 
->
{
122} normal block at 0x000366604 bytes long.
 Data: 
<    > CD CD CD CD 
Object dump complete.


posted @ 2010-10-03 19:48  谭志宇  阅读(1626)  评论(0编辑  收藏  举报