单选题 C++
题号 #2657093

有如下程序:
#include<iostream>
using namespace std;
class Base{
private:
    void fun1() const {cout<<”fun1”;}
protected:
    void fun2() const {cout<<”fun2”;}
public:
    void fun3() 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();  //④
}
其中没有语法错误的语句是(  )。

进入在线模考

参考答案

D

答案解析

暂无解析

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考