64,651
社区成员
发帖
与我相关
我的任务
分享
class B{
public:
B (int x,int y){
i=x;
j=y;
cout<<"test"<<i<<","<<j<<endl;
}
B (const B& a){
cout<<"const"<<a.i<<","<<a.j<<endl;
}
B& operator=(const B& a){
cout<<"oper:"<<(*this).i<<","<<(*this).j<<endl;
return *this;
}
private:
int i;
int j;
};
int main()
{
B x(1,2);
B y(3,4);
B z=(x=y);