day11pm

2165 단어
#include
using namespace std;

class A{
int data;
public:
A():data(100){cout<<"A()"<<endl;}
A(const A& o)/*:data(o.data)*/{cout<<"A(const A&)"<<endl;}

//A(const A& o):data(o.data){cout<

void show(){
cout<<"data="<endl;
}
virtual ~A(){cout<<"~A()"<<endl;}

};

void show(A obj)
{
obj.show();
}

int main(){
A a1;
a1.show();
cout<<"/////////////////////////////"<<endl;
A a5(a1);
a5.show();
}

 
전재 대상:https://www.cnblogs.com/Flyzhcong/p/3624801.html

좋은 웹페이지 즐겨찾기