写出程序的output
#i nclude
class a {
private:
int num;
public:
a() {
cout<<"default constructor"<< endl;
}
~a() {
cout<<"desconstructor"<< endl;
cout< }
a(const a &a){
cout<<"copy constructor"< }
void operator=(const a &a) {
cout<<"overload operator"< }
void setnum(int n) {
num=n;
}
};
void main()
{
a a1;
a a2(a1);
a a3=a1;
a &a4=a1;
a1.setnum(1);
a2.setnum(2);
a3.setnum(3);
a4.setnum(4);
}