65,209
社区成员
发帖
与我相关
我的任务
分享
一语道破,谢了
哦,调用的是默认的复制构造函数 谢谢Automation_dmu class A
{
public:
A():m(10)
{
cout<<"constuctor A is called!"<<endl;
}
A(const A&){cout<< "A(const A&)" <<endl;}
A& operator =(const A&) {cout<< "operator =(const A&)" <<endl;return *this;}
int m;
};将A类改成这样,你就明白了!