填空题

在成员函数声明的前面加上关键词 【11】 修饰,即把该函数声明为虚函数。

【参考答案】

virtual
<上一题 目录 下一题>
热门 试题

填空题
带有虚基类的多层次派生类构造函数的成员初始化列表中都要列出虚基类的构造函数,这样对虚基类的子对象初始化 【10】 次。
填空题
如下程序执行后的输出结果是 【14】 。 #include <iostream> using namespace std; class Base public: Base(int x,int y) a=x; b=y; void Show() cout<< Base: <<a<< ’,’ <<b<< ; private: int a,b; ; class Derived : public Base public: Derived(int x, int y, int z) : Base(x,y),c(z) void Show() cout<< Derived: <<c<<end1; private: int c; ; int main() Base b(100,100),*pb; Derived d(10,20,30); pb=&b; pb->Show(); pb=&d; pb->Show(); return 0;
相关试题
  • 以下程序设计功能是:将结构体变量time 中...
  • 有以下程序: #include <iostream> u...