题目内容

classMyClass{public: MyClass(){cout<<'A';} MyClass(MyClass&a){cout<<'B';} ~MyClass(){cout<<'C';}};intmain(){MyClassa;MyClassb(a);return0;}

查看答案
更多问题

写出以下程序运行结果。classmyclass{inta;public: myclass(int _a=0):a(_a){cout<<"1";} myclass(myclass&x){a=x.a;cout<<"2";} ~myclass(){cout<

写出以下程序运行结果。classCExample{private: inta;public: CExample(intb) {cout<<"1";a=b;} CExample(constCExample&C){a=C.a;cout<<"2";}voidShow(){cout<

写出以下程序运行结果。#includeusingnamespacestd;classBASE{public: BASE(inti){cout<<"A";p=i;} BASE(constBASE&other){cout<<"B";p=other.p;}~BASE() {cout<<"C";} intget() {returnp;}private: intp;};voiddisplay(BASEobj) {cout<

#includeusing namespace std;class example{ int a;public:example(int i=0){a=i;cout<<"A"<

答案查题题库