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

下列输出结果为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日

悬赏问题

  • ¥15 前端预览docx文件,文件从后端传送过来。
  • ¥15 层次聚类和蛋白质相似度
  • ¥25 主成分分析中的第一第二主成分分别代表哪些参数
  • ¥15 oracle数据库查询语句问题
  • ¥15 有没有c++绘制算法的佬们吗救孩一下
  • ¥15 android 蓝牙闪退
  • ¥15 绝缘子污秽comsol仿真参数
  • ¥15 labelme生成的json有乱码?
  • ¥30 arduino vector defined in discarded section `.text' of wiring.c.o (symbol from plugin)
  • ¥20 如何训练大模型在复杂因素组成的系统中求得最优解