weixin_57707228 2021-12-05 20:32 采纳率: 71.4%
浏览 32
已结题

下列输出结果为222

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;
}

  • 写回答

1条回答 默认 最新

  • qzjhjxj 2021-12-05 21:05
    关注

    输出: 3

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 5月8日
  • 已采纳回答 4月30日
  • 创建了问题 12月5日