百思不得其解
#include<iostream>using namespace std;
class B1{
public:
B1(int i){
cout<<"constructing B1:"<<i<<endl;
}
};
class B2{
public:
B2(int i){
cout<<"constructint B2:"<<i<<endl;
}
};
class B3{
public:
B3(){
cout<<"constructing B3:@"<<endl;
}
};
class C:public B1,public B2,public B3{
B1 member1;
B2 member2;
B3 member3;
public:
C(int a,int b,int c,int d):B2(b),member2(d),B1(a),member1(c){}
};
int main(int argc,char* argv[]){
C c(1,2,3,4);
system("pause");
return 0;
}
请指教本程序的详细运行过程。谢谢!