64,637
社区成员
发帖
与我相关
我的任务
分享
Test& operator = (const Test& t ){
a = t.a;
*(p) = *(t.p);
return *this;
}
Test& operator =(const Test& str)//赋值运算符
{
if (this != &str)
{
if (name != NULL)
delete name;
this->id = str.id;
p=new string(*str.p);
}
return *this;
}