[单选题]有如下程序:
#include  <iostream>
using namespace std;
class test
{
private:
int a;
public:
test( ){cout<<”constructor”<< endl;}
test(int a){cout<<a<<endl; cout<<”constructor”<< 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
constructor destructor
C
copy constructor
D
3 constructor destructor
正确答案:D
扫描二维码
免费搜题、免费刷题、免费查看解析