#include
using namespace std;
class obj{
public:
obj(int a)
{
qDebug()<<“in obj”;
num=a;
}
~obj()
{
qDebug()<<“in ~obj”;
}
int num;
};
void fun(shared_ptr& o)
{
o->num=300;
}
int main(int argc, char *argv[])
{
{
shared_ptr o=make_shared(200);
//o->num=10;
fun(o);
qDebug()<<“num is:”<num;

}
return 0;

}