在如下继承层次下,当实例化有派生类对象时,调用构造函数的顺序为:class Base{…};class Base1: virtual Base{…};class Base2: virtual Base{…};class Derived : public Base2, public Base1{…};
A. Base(), Base2(), Base1(), Drived()
Base(), Base1(), Base(), Base2(), Drived()
C. Base(), Base2(), Base(), Base1(), Drived()
D. Base(), Base1(), Base2(), Drived()
如有基类Base和派生类Derived,实例化对象Base b;Derived d;叙述正确的是:
A. Derived* pDev = new Base();
B. Derived类中不能定义与Base类同名的成员,以免引用时引起歧义
C. Base* pb =&d ; Derived* pd = &b; 为正确的赋值操作
D. Base& rb = d; Base bb = d; 为正确的赋值操作