#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;
}
#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;
}