单项选择题
有如下程序:
#include <iostream>
using namespace std;
class Point
public:
static int number;
public:
Point() number++;
~Point() number--;
;
int Point::number=0;
void main()
Point *ptr;
Point A,B;
Point* ptr_point=new Point[3];
ptr=ptr_point;
Point C;
cout<<Point::number<<endl;
delete []ptr;
运行时输出的结果是
A.3
B.4
C.6
D.7
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
下列描述中,错误的是( )。
A.公有继承时基类中的公有成员在派生类中仍是公有成员
B.公有继承时基类中的保护成员在派生类中仍是保护成员
C.保护继承时基类中的公有成员在派生类中仍是公有成员
D.保护继承时基类中的保护成员在派生类中仍是保护成员
点击查看答案
单项选择题
下面程序的运行结果是( )。 #include <iostream.h> class Sample int x,y; public: Sample() x=y=0; Sample(int a,int b) x=a;y=b; void disp() cout<< x= <<x<< ,y= <<y<<endl; ; void main() Sample s(2,3), *p=&s; p->disp();
A.x=1,y=2
B.x=2,y=4
C.x=2,y=3
D.x=4,y=3
点击查看答案
相关试题
下面程序的运行结果是______。 #in...
在下面横线上填上适当的语句,完成程序。 ...
下列程序的输出结果是______。 #in...
已知数组a中的元素个数为n,下列语句的作用...
有如下程序: #include <iostream.h>...