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;
}
下列输出结果为222
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-