【发布时间】:2010-07-17 18:49:43
【问题描述】:
谁能解释一下this code from C++ Reference site:
#include <iostream>
#include <memory>
using namespace std;
int main () {
auto_ptr<int> p;
p.reset (new int);
*p=5;
cout << *p << endl;
p.reset (new int);
*p=10;
cout << *p << endl;
return 0;
}
【问题讨论】:
标签: c++ pointers smart-pointers auto-ptr