单项选择题
有如下程序: #include<iostream> using namespace std; class Base { private: void funl()const {cout<<"funl";} 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.funl(); //① obj.fun2(); //② obj.fun3(); //③ obj.fun4(): //④ return 0; } 其中有语法错误的语句是
A.①②③④
B.①②③
C.②③④
D.①④
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下类声明: class SAMPLE { int n; public: SAMPLE(int i=0):n(i) { } void setValue(int nO); }; 下列关于getValue 成员函数的实现中,正确的是
A.SAMPLE::setValue(int n{ n=nO;}
B.void SAMPLE::setValue(int n{ n=nO;}
C.void setValue(int n{ n=nO;}
D.(int n{ n=nO;}
点击查看答案&解析
单项选择题
有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout << left << setw(4) << 123 << OK << endl; return 0; }
A.123*OK
B.123*OK**
C.*123OK
D.*123**OK
点击查看答案&解析
相关试题
有如下类定义: class AA { int a;...
有如下程序: #include<iostream> usi...
有如下程序: #include<iostream> usi...
有如下程序: #include<iostream> usi...
有如下程序: #include<iostream> usi...