有如下程序: #include using namespace std; class BASE { public

18 查阅

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

A.BASE

B.DERIVED

C.BASEDERIVED

D.DERIVEDBASE

参考答案:

D解析:本题考查基类析构函数和派生类析构函数的调用次序。

计算机二级