今天开始写c++ effective的读书笔记。
以对象管理资源需要pointer-like object,即智能指针。
#include "stdafx.h"
#include "iostream"
#include "memory"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int* p=new int(12);
std::auto_ptr<int> pint(p);
cout<<*pint<<endl;
cin.get();
return 0;
}
撰写C++《Effective》读书笔记:智能指针的应用
11万+

被折叠的 条评论
为什么被折叠?



