有如下程序,运行时输出的结果是。#include<
有如下程序,运行时输出的结果是()。
#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;
}答案
D