正在加载图片...
风0:43:0 §2类与对象 类 类的定义 例:点类 c1ass类名 class Point private private: float fx fY: 私有成员表; public: public void setX(int x)(fX=x 公有成员表; void setY(int y)(fY=y protected: float getXO return fX 保护成员表; float geto return fY;20:43:40 §2 类与对象 class 类名 { private: 私有成员表; public: 公有成员表; protected: 保护成员表; }; 例:点类 class Point{ private: float fX,fY; public: void setX(int x){fX=x;} void setY(int y){fY=y;} float getX(){return fX;} float getY(){return fY;} }; 一.类 .类的定义:
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有