问答题
有如下程序:
#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;
return 0;
执行后的输出结果是( )。
【参考答案】
A
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include<iostream> using namespace std; class Complex double re,im; public: Complex(double r,double i):re(r),im(i) double real()constreturn re; double image()constreturn im; Complex& operator+=(Complex
A.
&
点击查看答案&解析
填空题
数据结构分为逻辑结构和存储结构,循环队列属于______结构。
点击查看答案&解析
相关试题
定义一个函数名为fun,返回值为int,没有参...
如果表达式x=y*z中的“*”是作为成员函...
重新定义标识符的作用域规定是外层变量被隐...
执行下列程序的输出结果是______: ...
动态多态性通过______实现。