单项选择题
有如下程序: #include<iostream> using namespace std; class AA{ int n; public: AA(int k):n(k){} int get(){return n;) int get()const{return n+1;} }; int main() { AA a(5); const AA b(6); cout<<a.get()<<b.get(); return 0; } 执行后的输出结果是
A.55
B.57
C.75
D.77
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
诊断和改正程序中错误的工作通常称为______。
点击查看答案&解析
单项选择题
有如下程序: #include<iostream.h> using namespace std; class Demo { public: Demo(){ cont<< default constructor n ;} Demo(const Demo &x){ cont<< copy constructor n ;} }; Demo userCode(Demo b){Demo c(b);return c;} int main() { Demo a,d; cout<< calling userCode() n ; d=userCode(a); return 0; } 执行上面程序的过程中,构造函数Demo()和Demo(const Demo &x)被调用的次数分别是
A.1和1
B.1和2
C.2和3
D.2和4
点击查看答案&解析
相关试题
______允许用户为类定义一种模式,使...
下列程序的输出结果是______。#incl...
以下函数模板max()的功能是:返回数组a中...
下列程序的输出结果为2,请将程序补充完整...
派生类中的成员不能直接访问基类中的___...