欢迎来到PP题库网 PP题库官网
logo

单项选择题

有如下程序:
#include<iostream>
using namespace std;
class test{
private:
int a;
public:
test(){cout<<"constructor"<<endl;}
test(int a){cout<<a<<endl;}
test(const test &_test){
a=_test.a;
cout<<"copy constructor"<<endl;
}
~test(){cout<<"destructor"<<endl;}
};
int main(){
test A(3);
return 0;
}
执行这个程序的输出结果是______。

    A.3
    B.constructordestructor
    C.copy constructordestructor
    D.3destructor
点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题