单选题 有如下程序:
#include <iostream >
using namespace std;
class Point {
public:
static int number;
public:
Point( ) {number++ ; }
~Point() { number- -; }
};
int Point::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。