C++的虚继承小问题
class A{
public: A ( int a );
...
};
class B: virturl public A {
public:
B ( int b ) : A( a ) ;
...
};
class C: virturl public A {
public:
C ( int b ) : A( a ) ;
...
};
class D: public B ,public C {
public:
D(???????????????????
};
类 D 的构造函数应该怎样写??
参考答案:D(int d):A(d),B(d),C(d){
}
就是这样的