4.列程序的输出结果为( )。#include
using namespace std;
class test
{
private:
int a;
public:
test()
{
cout<<"constructor"<<endl;
}
test(int a)
{
cout<<a<<endl;
}
test(test &t)
{
a=t.a;
cout<<"copy constructor"<<endl;
}
~test()
{
cout<<"destructor"<<endl;
}
};
int main()
{
test A(3);
return 0;
}
输出: 3