单项选择题
有如下程序: #include<iostream> using namespace std; class Base1{ public: Base1(int D) {cout<<d;} ~Base1(){} }; class Base2{ public: Base2(int D) {cout<<d;} ~Base2 (){} }; class Derived:public Base1, Base2{ public: Derived(int a, int b, int c, int D) ; Base1(B) , Base2(A) , b1(D) , b2(C) {} Private: int b1; int b2; }; int main(){ Derived d(1, 2, 3, 4); return 0; } 运行时的输出结果是( )。
A.1234
B.2134
C.12
D.21
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序:#include<iomanip>#include<iostream>using namespace std;int main(){cout<<setfill('*')<<setw(6)<<123<<456;return 0;}运行时的输出结果是( )。
A.***123***456
B.***123456***
C.***123456
D.123456
点击查看答案&解析
单项选择题
若为Fraction类重载前增1运算符++,应在类体中将其声明为( )。
A.Fraction& operator++();
B.Fraction& operator++(int);
C.friend Fraction& operator++();
D.friend Fraction& operator++(int);
点击查看答案&解析
相关试题
私有成员
已知类Ben中将二元运算符“ ”,重载为友...
保护成员
有如下程序:#include<iostream>using ...
C++中的模板分为函数模板和__【15】...