现在的位置: 首页 > 综合 > 正文

内存泄漏问题

2013年04月19日 ⁄ 综合 ⁄ 共 184字 ⁄ 字号 评论关闭

#include "stdafx.h"
#include <memory>

int _tmain(int argc, _TCHAR* argv[])
{
int *p = new int(3);
int &ref = *p;
ref = 4;
int newp = 5;
std::auto_ptr<int> pAuto(new int(6)); 
ref = *pAuto.release();
delete p;
return 0;
}

抱歉!评论已关闭.