单项选择题
有如下程序:
#include<iostream>
using namespace std;
class Test
public:
Test() n+=2;
~Test() n-=3;
static int getNum()return n;
private:
static int n;
;
int Test::n=1;
int main()
Test* p=new Test;
delete p;
cout<<"n="<<Test::getNum()<<endl;
return0;
执行后的输出结果是( )。
A.n=0
B.n=1
C.n=2
D.n=3
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
软件详细设计的主要任务是确定每个模块的( )。
A.算法和使用的数据结构
B.外部接口
C.功能
D.编程
点击查看答案
单项选择题
执行语句序列 ofstream outfile( data.dat ); if(...)cout<< ok ;else cout<< fail ; 后,如果文件打开成功,显示“ok”,否则显示“fail”。由此可知,上面if语句的“...”处的表达式是( )。
A.outfile.fail()或outffle
B.outfile.good()或!outfile
C.outfile.good()或outfile
D.outfile.fail()或!outfile
点击查看答案
相关试题
有如下程序: #include<iostream> usi...
下列类的定义中,有( )处语法错误。 cl...
有如下程序: #inchde<iostream.h> v...
若有以下程序: #include<iostream> u...