单项选择题
为完成下面的程序,应在划线处填入的语句是 #include<iostream> using namespace std; class Base { private: int x; public: Base(int i) { x=i; } ~Base(){} }; class Derived:public Base { public: ______ //完成类Derive构造函数的定义 }; int main() { Derived obj; return 0; }
A.Derived(int :Base({}
B.Derived(){}
C.Void Derived (int :Base({}
D.Denved(int {Base(;}
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
函数swap(arr,n)可完成对arr数组从第1个元素到第n个元素两两交换。在运行调用函数中的语句后,a[0]和a[1]的值分别为 【7】 。a[0]=1;a[1]=2;swap(a,2);
点击查看答案&解析
填空题
设有定义语句:double x=2.5, y=4.7;int a=7;那么表达式x+a%3*(int)(x+ y)%2 4的值为 【6】 。
点击查看答案&解析
相关试题
下面是“二维向量”vector2D的定义,其中...
已知:double A(double A) {return+...
有以下程序:#include<iostream.h>clas...
下面程序的输出结果是 【15】 。#incl...
在下面横线上填上适当的语句,完成程序。#...