单项选择题
有如下程序:
#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
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include <iostream> using namespace std; class AA int n; public: AA(int k):n(k) int get() return n; int get()const retnm n+1; int main() AA a(5); const AA b(6); cout <<a.get()<<b.get(); return 0; 执行后的输出结果是______ 。
A.55
B.57
C.75
D.77
点击查看答案&解析
单项选择题
有如下类声明: class MyBASE int k; public: void set(int n) k=n; int get()const return k; ; class MyDERIVED: protected MyBASE Protected: int j; public: void set(int m,int n)MyBASE:: set(m);j=n; int get () const return MyBASE:: get ()+j; ;则类MyDERIVED 中保护的数据成员和成员函数的个数是______ 。
A.4
B.3
C.2
D.1
点击查看答案&解析
相关试题
有如下函数模板定义: template<class T...
要定义一个具有5个元素的一维数组vect,并...
在表达式x+y*z中,+是作为成员函数重载...
数据库系统的核心是______ 。
下列关于C++函数的叙述中,正确的是__...