写出以下程序运行结果。已知类CC和函数test的定义如下:classCC{public: CC(){cout<<'1';} CC(CC&c){cout<<'3';} ~CC(){cout<<'0';}};voidtest(CCc) {cout<<'2';}intmain(){ CCC; test(C); return0;}
查看答案
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<