填空题
若有以下程序:
#include <iostream>
using namespace std;
class Sample
private:
const int n;
public:
Sample(int i) :n(i) )
void print()
cout<<"n="<<n<<end1;
;
int main()
sample a(10);
a.print();
return 0;
上述程序运行后的输出结果是
【14】
。
【参考答案】
n=10
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
【13】 使一个函数可以定义成对许多不同数据类型完成同一个任务。
点击查看答案&解析
填空题
对虚函数的调用有两种方式: 【11】 和 【12】 。
点击查看答案&解析
相关试题
有以下程序: #include <iostream> ...