有如下程序:#include <iostream>using namespace std;class Base{ public: Base(){cout<<"BB"; f(); } Void f(){cout<<"Bf"; }};clas

admin2013-02-27  31

问题 有如下程序:#include <iostream>using namespace std;class Base{    public:    Base(){cout<<"BB"; f(); }    Void f(){cout<<"Bf"; }};class Derived: public Base{    public:    Derived() { cout<<"DD"; }    void f() { cout<<"Df"; }};int main() { Derived d; return 0; }执行上面的程序将输出(    )。

选项 A、BBBfDD
B、BBDfDDDf
C、DD
D、DDBBBf

答案1

解析
转载请注明原文地址:https://jikaoti.com/ti/bpL0FFFM
0

最新回复(0)