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

admin2009-01-15  41

问题 有如下程序:#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://kaotiyun.com/show/3Vkp777K
0

随机试题
最新回复(0)