单选题 C++
题号 #2606895

有如下程序:
#inClude<iostream>    using namespaCe std;    Class Point{
publiC:
statiC int number;
publiC:
Point(  )t.number++;}        ~Point(  ){number--;}
};    ,  int P0int::number=0;
int main(  ){
Point *ptr:
Point A,B;      Point*ptr_point=new Point[3];    ptr=ptr_point;’
}
Point C;
Cout<<Point:::number<<endl;    delete[]ptr;
return 0;    }
执行这个程序的输出结果是(  )。

进入在线模考

参考答案

C

答案解析

本题考查默认构造函数.题目中定义.个对象A、B以及对象数组Point[3],又定义了对象C,共执行6次构造函数,number变为了6,所以本题答案为C。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考