更多“Sound, visual or other signal to a team ordering it to return to its base is ______.A.Come ”相关问题
  • 第1题:

    有如下程序:includeusing namespace std;class BASE{public:~BASE( ){cout<<"BASE";}

    有如下程序: #include<iostream> using namespace std; class BASE{ public: ~BASE( ){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED( ){cout<<"DERIVED";} }; int main( ){DERIVED x;return 0;} 程序的输出结果是

    A.BASE

    B.DERIVED

    C.BASEDERIVED

    D.DERIVEDBASE


    正确答案:D
    解析:基类和派生类的析构函数的执行顺序是先执行派生类的析构函数,最后执行基类的析构函数;故先执行DIVERED的析构函数,后执行BASE的析构函数。

  • 第2题:

    有如下程序:include using namespace std;class BASE{public:~BASE() {cout<<"BASE";

    有如下程序: #include <iostream> using namespace std; class BASE{ public: ~BASE() {cout<<"BASE"; } }; class DERIVED: public BASE { public: ~DERIVED() {cout<;"DERIVED"; } }; int main(){DERIVED x; return 0;} 执行后的输出结果是______ 。

    A.BASE

    B.DERIVED

    C.BASEDERIVED

    D.DERIVEDBASE


    正确答案:D
    解析:析构函数的调用顺序是,先调用派生类的析构函数,再调用基类的析构函数。

  • 第3题:

    有如下程序:includeusing namespace std;class BASE{public:~BASE(){cout<<"BASE";}}

    有如下程序: #include<iostream> using namespace std; class BASE{ public: ~BASE(){cout<<"BASE";} }; class DERIVED:public BASE{ public: ~DERIVED(){cout<<"DERIVED";} }; int main(){DERIVED x;return 0;} 执行后的输出结果是( )。

    A.BASE

    B.DERIVED

    C.BASEDERIVED

    D.DERIVEDBASE


    正确答案:D
    解析:此题考查的是派生类的定义和使用。当对象被删除时,派生类的析构函数就被执行。由于析构函数不能被继承,因此在执行派生类的析构函数时,基类的析构函数也将被调用。执行顺序是先执行派生类的析构函数,再执行基类的析构函数,其顺序与执行构造函数的顺序正好相反。

  • 第4题:

    有如下程序: #include<iostream> usingnamespacestd; classBASE{ public: ~BASE(){cout<<"BASE";} }; classDERIVED:publicBASE{ public: ~DERIVED(){cout<<"DERIVED";} }; intmain(){DERIVEDx;return0;) 执行后的输出结果是( )。

    A.BASE

    B.DERlVED

    C.BASEDERIVED

    D.DERlVEDBASE


    正确答案:D
    D。【解析】本题考查派生类的定义和使用。当对象被删除时,派生类的析构函数就被执行。由于析构函数不能被继承,因此在执行派生类的析构函数时,基类的析构函数也将被调用。执行顺序是先执行派生类的析构函数,再执行基类的析构函数,其顺序与执行构造函数的顺序正好相反。所以当main函数结束时,派生类DERIVED的对象X将被删除,那么派生类DERIVED的析构函数先被调用,输出DERIVED,然后调用基类的析构函数输出BASE。

  • 第5题:

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


    正确答案:B
    本题考查公用继承对基类成员的访问属性。在公用继承中,基类的公用成员和保护成员在派生类中保持原有的访问属性,其私有成员仍为基类私有。本题中想要输出Base::fun,则必须调用基类的公用成员函数fun,所以使用Base::fun;来调用基类的成员函数fun。

  • 第6题:

    He works in a sports centre instructing people in the use of the gym equipment.

    A:helping
    B:teaching
    C:informing
    D:ordering

    答案:B
    解析:
    本句话的意思:“他就职于一家健身中心,教人们如何使用健身器材。”句中instruct意为“指导,教导”,如:His uncle instructed him in French.他的叔叔教他法语。help 意为“帮助”;teach意为“教”;inform意为“通知”;order意为“命令”。只有teach意思上和instruct最接近。