填空题
在下面横线上填上适当的语句,完成程序。 #include<iostream> using namespace std; class Base { int x; public: Base(int i){x=i;} ~Base(){} }; class Derived : public Base { public:
【10】
/完成类Derive构造函数的定义 }; int main () { Derived Obj; return 0; }
【参考答案】
Derived (int i):Base(i){}
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下列程序的输出结果是 【8】 #include<iostream>using namespace std;int main(){int num=500;int &ref=num;ref +=100;cout<<num<<end1;return 0;}
点击查看答案&解析
填空题
类模板的使用实际上是将类模板实例化成一个具体的 【9】 。
点击查看答案&解析
相关试题
下面是“二维向量”vector2D的定义,其中...
已知:double A(double A) {return+...
有以下程序:#include<iostream.h>clas...
下面程序的输出结果是 【15】 。#incl...