问题
填空题
下列程序的输出结果为
Object id=0
Object id=1
请将程序补充完整。
#include <iostream>
using namespace std;
class Pointpublic:
Point(int xx=0,int yy=0) X=xx; Y=yy; countP++;
~Point()countP--;
int GetX()retum X;
int GetY()return Y;
static void GetC() cout<<"Object id="<<countP<<end1;
private:
int X,Y;
static int countP;
;
【11】 //静态数据成员的初始化
int main() Point:: GetC();
Point A(4,5);
A. GetC();
retum 0;
答案
参考答案:int Point::countP=0;