填空题

请将下列类定义补充完整。
class Base public:void
fun() cout<<"Base:: fun"<<end1; ;
class Derived: public Base
public:
void fun()
【13】 //显式调用基类的fun函数
cout<<"Derived:: fun"<<end1;

;

【参考答案】

Base:: fun();
<上一题 目录 下一题>
热门 试题

填空题
下列程序的输出结果为: Object id=0 Object id=1请将程序补充完整。 #include <iostream> using namespace std; class Point public: Point(int xx=0,int yy=0) X=xx;Y=yy;countP++; ~Point() countP--; int GetX() return X; int GetY() return Y; static void GetC0 cout << Objectid= <<countp<<end1; private: int X,Y; static int countP; ; 【9】 静态数据成员的初始化 int main() Point:: GetC(); Point A(4,5); A.GetC(); return 0;
填空题
派生类中的成员不以直接访问基类中的 【11】 成员。
相关试题
  • 多数运算符既能作为类的成员函数重载,也能...
  • 下面是一个栈类的模板,其中push函数将元素...
  • 下列程序的输出结果为2,请将程序补充完整...
  • 非成员函数应声明为类的 【10】 函数才...