![]() |
#2
yangfrancis2017-03-05 15:23
|
#include <iostream>
#include <stdio.h>
#include <memory>
#include <string>
using namespace std;
int main( )
{
shared_ptr<string> p1 ;
string str = "abc" ;
if ( !p1 ) {
*p1 = str ;
}
cout<<*p1<<endl;
return 0 ;
}