题目内容:
有如下程序:#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
参考答案:
答案解析: