单项选择题
有如下程序: #include usingnamespacestd; classTest { public: Test(){n+=2;} ~Test(){n-=3;} staticintgetNum(){returnn;} private: staticintn; }; intTest::n=1; intmain() { Test*p=neWTest; deletep; cout<<"n="< return0; } 执行该程序的输出结果是( )。
A.n=0
B.n=1
C.n=2
D.n=3
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include usingnamespacestd; classTestClass {public: virtualvoidfunl() {coutfun1(); p->fun2(); return0;} 该程序执行后的输出结果是( )。
A.funlTestClasslfun2TestClass
B.funlTestClass1fun2TestC1ass1
C.funlTestClassfun2TestClass
D.funlTestClassfun2TestClassl
点击查看答案&解析
单项选择题
已知枚举类型定义语句为 enHmToken{NAME,NUMBER,PLUS=5,MINUS,PRINT=10}; 则下列叙述中错误的是( )。
A.枚举常量NAME的值为1
B.枚举常量NUMBER的值为1
C.枚举常量MINUS的值为6
D.枚举常量PRINT的值为10
点击查看答案&解析
相关试题
使用VC6打开考生文件夹下的源程序文件2....
对于类定义: classA{ public: virtua...
使用VC++6.0打开考生文件夹下的源程序...
使用VC++6.0打开考生文件夹下的源程序...
以下程序的输出结果是( )。 #include...