单项选择题
有如下程序:
#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 Test( public: Test() cnt++; ~Test() cnt--; static int Count()return cnt; private: static int cnt; ; int Test::cnt=0; int main() cout<<Test::Count()<< ; Test t1,t2; Test*pT3=new Test; Test*pT4=new Test; cout<<Test::Count()<< ; delete pT4; delete pT3; cout<<Test::Count()<<end1; return 0;
A.024
B.042
C.420
D.240
点击查看答案&解析
单项选择题
下列程序的执行结果是______。 #include<iostream.h> #include<stdlib.h> class TestClass public: int x,y; TestClass () x=y=0; TestClass (int a,int b)x=a;y=b; void disp() cout<< x= <<x<< ,y= <<y<<end1; void main() TestClass s1(2,3); s1.disp();
A.x=2,y=2
B.x=2,y=3
C.x=3,y=2
D.x=3,y=3
点击查看答案&解析
相关试题
函数swap(a,n)可完成对a数组从第1个元...
有下列二叉树,对此二叉树中序遍历的结果为...
下列关于栈的描述中错误的是( )。
下列叙述中错误的是( )。
静态数据成员是为( )的数据。