网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

请将下列类定义补充完整,横线处应填加语句______。

class TestClass{public:void fun(){cout<<"Base::fun"<<end1;}};

class TestClass1:public TestClass

{

public:

voidfun()

{

______;//显示调用基类的fun函数

cout<<"TestClass1::fun"<<end1;

}

};


参考答案

更多 “ 请将下列类定义补充完整,横线处应填加语句______。class TestClass{public:void fun(){cout<<"Base::fun"<<end1;}};class TestClass1:public TestClass{public:voidfun(){______;//显示调用基类的fun函数cout<<"TestClass1::fun"<<end1;}}; ” 相关考题
考题 请将下列类定义补充完整。class Base{public:void fun(){tout<<"Base::fun"<<endl;}};class Derived:public Base{public:void fun(){______//显示调用基类的fun函数cout<<"Derived::fun"<<endl;};

考题 请将下列类定义补充完整class Base{public: void fun(){cout<<"Base::fun"<<end1;}};class Derived:public Base{public:void fun(){______//显式调用基类的fun函数cout<<"Derived::fun"<<end1;}};

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

考题 在下列横线处应添加的语句是( )。 class Base{public:void fun(){cout<<"Base::fun"<<end1;}}; class: Derived: public Base { public: void fun() { ______//显示调用基类的fun函数 cout<<"Derived::fun"<<end1; } };A.Derived::funB.Base::fun();C.Pubic::funD.fun();

考题 下列程序中横线处正确的语句是()。includeusing namespace std;class TestClass{publi 下列程序中横线处正确的语句是( )。 #include<iostream> using namespace std; class TestClass { public: void fun(){cout<<"TestClass::fun"<<end1;} }; class TestClass1:public TestClass { void fun() { ______//显示调用基类的函数 fun() cout<<"TestClass1::fun"<<end1; } };A.fun();B.TestClass.fun()C.TestClass::fun();D.TestClass->fun();

考题 请将下列程序的横线处补充完整,使得输出结果为bbaaincludeusing namespace std;class 请将下列程序的横线处补充完整,使得输出结果为bbaainclude<iostream>using namespace std;class A{public:______{cout<<"aa";}};class B:public A{public:~B(){cout<<"bb";}};int main(){B*p=new

考题 请将下列类定义补充完整。class Base{public:void fun(){cout<<"Base∷fun"<<end1;}};c1ass DehVed:public Base{public:void fun(){______ ∥显式调用基类的fun函数cout<<"Derived∷fun"<<endl;}};

考题 请将下列类定义补充完整。class Base{public:void fun( ){cout<<"Base::fun"<<endl;}};class Derived:public Base{public:void fun( ){______//显式调用基类的fun函数cout<<"Derived::fun"<<endl;}};

考题 下列程序的输出结果为2,横线处应添加语句()。includeusing namespace std;{public:___ 下列程序的输出结果为2,横线处应添加语句( )。 #include<iostream> using namespace std; { public: ______void fun(){cout<<1;} }; class TestClass2:public TestClass1 { public:void fun(){cout<<2;) }; int main() { TestClass1 *p=new TestClass2; p->fun(); delete p; Teturn 0; }A.publicB.privateC.virtualD.protected