问题
填空题
请将下列类定义补充完整。
class Base(public:void fun()cout<<"Base::fun"<<end1;;
class Derived:public Base
public:
void fun()
______//显式调用基类的fun函数
cout<<"Derived::fun"<<end1;
;
答案
参考答案:Base::fun();
解析: 此题考查的是成员函数的调用。因为横线处的作用是调用基类的fun函数,又因为派生类中也有fun()函数,所以必须对 fun()函数加以限定,即Base::fun();。