有如下程序: #include<iostream> using namespace std; class Base1{ public: Base1(int D){cout<<d;} ~Base1(){} };

admin2013-02-27  23

问题 有如下程序:
   #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

选项 A、 
B、 
C、 
D、 

答案D

解析
转载请注明原文地址:https://kaotiyun.com/show/u7Vp777K
0

最新回复(0)