有如下程序:#include <iostream>using namespace std;class Base{ private: void fun1() const {cout << "fun1"; } protected: void fun2(

admin2009-01-15  42

问题 有如下程序:#include <iostream>using namespace std;class Base{  private:  void fun1() const {cout << "fun1"; }  protected:  void fun2() eonst {cout << "fun2"; }  public:  void tim3() const { cout << "fun3"; }};  class Derived: protected Base{  public:  void fun4() const {cout << "fun4"; }};int main(){Derived obj;obj.fun1();// ①obj.fun2();// ②obj.fun3();// ③obj.fun4();// ④return 0;}其中有语法错误的语句是(    )。

选项 A、①②③④
B、①②③
C、②③④
D、①④

答案2

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

最新回复(0)