有如下程序:#include<iostream>;usingnamespacestd;classtest{

7 查阅

有如下程序:#include<iostream>;usingnamespacestd;classtest{

private:

inta;public:

test(){cout<<"constructor"<<endl;}

test(intt):a(t){cout<<a<<endl;}

test(consttest&_test)

{

a=_test.a;cout<<"copyconstructor"<<endl;}

~test(){cout<<"destructor"<<endl;}

};intmain()

{

testA(3);return0;}运行时的输出结果是()。

A.3

B.3destructor

C.copyconstructor

D.constructor

参考答案:

答案:3destructor