#include<iostream> using namespace std; class Point { public: Point(int a=3,int b=5){ X=a;Y=b;} int GetX(){return X;} int GetY(){return Y;} private: int X,Y; };
Point[0]. GetX()
p[0].GetX()
p->GetX()
GetX()
->主要用于类类型的指针访问类的成员
.主要用于类类型的对象访问类的成员
point是个类型
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题