下列程序划线处应填入的正确语句是()。 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();

下列程序划线处应填入的正确语句是()。 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();


参考答案和解析
D

相关考题:

有如下程序:#include +using namespace std ;#includeusing namespace std;class Base{public:void fun(){cout"Base::fun"};class Derived:public Base{public:void fun(){cout"Derived::fun"}};int main(){Derived d;d.fun();return 0;}已知其执行后的输出结果为:Base::funDerived::fun则程序中下划线处应填入的语句是A . Base.fun();B . Base::fun()C . Base-fun()D . fun();

( 11 )请在如下程序中的空格处填写正确的语句:#includeiostreamusing namespace std;class Base{public:void fun(){cout"Base fun"endl;}};class Derivde:public Base{public:void fun(){___________// 调用基类的函数 fun()cout"Derived fun"endl;}};

下列程序中划线处正确的语句是()。 include using namespace std;class Base{public:v 下列程序中划线处正确的语句是( )。 # include <iostream> using namespace std; class Base { public: void fun(){cout<<"Base:: fun" <<endl;} }; class Derived:public Base { void fun() { ______ ∥显式调用基类的函数fun() cout<<"DA.fun();B.Base.fun();C.Base::fun();D.Base- >fun();

下列程序中画线处应填入的语句是class Base{public:void fun(){cout ”Base of fun”};class Derived:public Base{void fun(){//显示基类的成员函数funcout ”Derived of fun”};A.fun();B.Base. fun();C.Base::fun();D.Base- fun-:

请将下列类定义补充完整。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;}};

请在下列程序中的横线处填写正确的语句。include using namespace std; class Base{ pu 请在下列程序中的横线处填写正确的语句。include<iostream>using namespace std;class Base{public:void fun(){cout<<“Basefun”<<endl;});class Derivde:public Base{public:void fun(){//调用基类的函数fun()cout<<“Derived fun”<<endl;}};

有如下程序:include using namespace std;class Base{ public: void fun() { cout 有如下程序: #include <iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun"<<endl; } }; class Derived : public Base { public: void fun() { ______ cout<<"Derived::fun"<<endl; } }; int main() { Derived d; d.fun(); return 0; } 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下划线处应填入的语句是( )。A.Base.fun();B.Base::fun();C.Base->fun();D.fun();

在下列横线处应添加的语句是( )。 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;classBase{public: 在下列程序画线处填入的正确语句是( )。 #include <iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun",<<end1; } }; class Derived:public Base { void fun() { ______________ //显式调A.fun();B.Base.fun();C.Base::fun();D.Base->fun();

有如下程序:include using namespace std;class Base{public:void fun() {cout 有如下程序:#include <iostream>using namespace std;class Base { public: void fun() {cout<<"Base:: fun"<<end1; }};class Derived: public Base ( public: void fun() { ____________________________ cout<<"Derived:: fun"<<end1; }};int main() { Derived d; D. fun(); return O;}已知其执行后的输出结果为:Base:: funDerived:: fun则程序中下划线处应填入的语句是( )。A.Base. fun ();B.Base:: fun ();C.Base->fun();D.fun()

下列程序中下画线处应填入的语句是class Base{public:void fun( ) {cout < < "Baseoffun" < < endl;}};class Derived:public Base{void fun( ){______//显示基类的成员函数funcout < < "Derived of fun" < < endl;}};A.fun( ) ;B.Base. fun( ) ;C.Base: :fun( ) ;D.Base->fun( ) ;

请将下列类定义补充完整。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;}};

将下面程序补充完整。 include using namespace std; class Base{ public: 【 】fun(){r 将下面程序补充完整。include <iostream>using namespace std;class Base{public:【 】 fun(){return 0;} //声明虚函数};class Derived:public Base{public:x,y;void SetVal(int a,int b){}int fun(){return x+y;}};void 【 】 SetVal(int a,int b){x=a;y=b;} //类Derived成员函数void main(){Derived d;cout<<d.fun()<<endl;}

下列程序中画线处应填入的语句是 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( );

应在下列程序画线处填入的正确语句是 ( )。include using namespace std;clas Base{pu 应在下列程序画线处填入的正确语句是 ( )。 #include <iostream> using namespace std; clas Base { public: void fun() { cout<<"Base::fun"<<end1; } }; class Derived : public Base { void fun() { ________________//显示调用基类的函数 fun() cout<<"Derived::fun"<<end1; } };A.fun();B.Base.fun();C.Base::fun();D.Base->fun();

下列程序中画线处应填入的语句是 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();

以下程序执行结果是 ( )。include class Base{public virtual void fun() {cout 以下程序执行结果是 ( )。 #include <iostream.h> class Base { public virtual void fun() { cout<<"B"; } }; class Derived { public: Derived() { cout<<"D"; } virtual void fun(){ Base::fun(); cout<<"C"; } } int main () { Base *ptr; Derived obj; ptr=obj; p->fun ( ); return 0; }A.DBCB.DCBC.BDCD.CBD

有如下程序: include using namespace std; class Base { public: 有如下程序: #include<iostream> using namespace std; class Base { public: void fun() { cout<<"Base::fun"<<endl; } }; class Derived: public Base { public: void tim() } ____________ cout<<"Derived:: fun"<<endl; } }; int main() { Derived d; d.fun(); return O; } 已知其执行后的输出结果为: Base::fun Derived::fun 则程序中下划线处应填入的语句是A.Base.fun();B.Base::fun();C.Base->fun();D.fun();

为使程序的输出结果为: Base:: fun 那么应在下列程序画线处填入的正确语句是( )。 #include <iostream> using namespace std; class Base { public: void fun () { cout<<"Base: :fun"<<end1; } }; class Derived : public Base { public: void fun ( ) { cout<<"Derived: :fun"<<end1; } }; int main ( ) { Base a,*pb; Derived b; _________; pb->fun(); //调用基类的成员函数 fun() return 0 ; }A.pb=aB.pb=bC.pb=bD.pb=Base

下列程序中横线处应填入的语句是( )。 Class Base { public: roid fun(){cout<<“Base of fun”<<endl;) }; class Derived:public Base { void fun() { //显示基类的成员函数fun cout<<“Derived Of fun”<<endl; } };A.fun();B.Base.fun();C.Base::fun();D.Base->fun();

有如下程序:nclude using namespace std;class Base{public:void fun1() {cout 有如下程序:#nclude <iostream>using namespace std;class Base{ public:void fun1() {cout << "Base\n"; }virtual void fun2() {cout << "Base\n"; }};class Derived: public Base{ public:void fun1() {cout << "Derived\n"; }void fun2() {cout << "Derived\n"; }} void f(Base b) { B. fun1(); B. fun2(); }int main(){Derived obj;f(obj);return 0;}A.Base BaseB.Base DerivedC.Derived BaseD.Derived Derived

有如下程序: #includeiostream 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;

下列程序中划线处正确的语句是()。include using namespace std;class Base{public:vo 下列程序中划线处正确的语句是( )。#include <iostream>using namespace std;class Base{public:void fun() { cout<<"Base:: fun"<<end1; }};class Derived: public Base{ void fun() { _______________________ //显试调用基类的函数 fun() cout <<"Derived:: fun"<<end1;};A.fun();B.Base. fun();C.Base:: fun();D.Base->fun();

请在如下程序中的空格处填写正确的语句: include using namespace std; class Base { 请在如下程序中的空格处填写正确的语句:include <iostream>using namespace std;class Base {public:void fun() {cout<<"Base fun"<<endl; }};class Derived: public Base {public:void fun() {【 】; //调用基类的函数fun()cout<<"Derived fun "<<endl;}};

请在下列程序的横线处填写正确的语句。include using namespace std; class Base{ publ 请在下列程序的横线处填写正确的语句。include<iostream>using namespace std;class Base{public:void fun(){cout<<"Base fun"<<endl;}};class Derivde:public Base{public:void fun(){______∥ 调用基类的函数