下列程序中画线处应填入的语句是
class Base
{
public:
void fun(){cout <<”Base of fun”<
};
class Derived:public Base
{
void fun()
{
//显示基类的成员函数fun
cout <<”Derived of fun”<
};
A.fun();
B.Base. fun();
C.Base::fun();
D.Base- >fun-:
第1题:
下列程序中画线处应填入的语句是 class Base { public: void fun( ){cout<<"Base of fun"<<end1;} }; class Derived:public Base { void fun( ) { ______//显示基类的成员函数fun cout<
A.fun( );
B.Base.fun( );
C.Base: :fun( );
D.Base->fun( );
第2题:
有如下程序: #include<iostream> using namespace std; classBase{ public: void fun{ __________________ cout<<”Base::fun”<<endl;} }; class Derived:public Base{ public: voidfun{ cout<<”Derived::fun”<<endl: } }; int main{ Derived d; A fun; return 0; } 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下画线处应填入的语句是( )。
A. Base.fun;
B.Base::fun;
C.Base—>fun;
D.fun;
第3题:
下列程序划线处应填入的正确语句是()。 class Base { public: void fun(){ cout<<"Base::fun"<<endl; } }; class Derived:public Base { public: void fun() { _____________ //显示调用基类的函数fun() cout<<"Derived::fun"<<endl; } };
A.fun();
B.Base.fun();
C.Base::fun();
D.Base->fun();
第4题:
下列程序中画线处应填入的语句是 class Base { public: void fun(){cout<<"Base of fun"<<end1:} }; class Derived:public Base { void fun() { _______//显示基类的成员函数fun cout<<"Derived of fun"<<end1; } };
A.fun();
B.Base.fun();
C.Base∷fun();
D.Base- >fun();
第5题:
请在下列程序的横线处填写正确的语句。
include<iostream>
using namespace std;
class Base{
public:
void fun(){cout<<"Base fun"<<endl;}
};
class Derivde:public Base{
public:
void fun(){
______∥ 调用基类的函数