正在加载图片...
class Rectangle:public Point /派生类定义部 分 public: //新增公有函数成员 void initRectangle(float x,float y,float w, float h){ initPoint(x,y);//调用基类公有成员函数 this->ww; this->hh; float getH()const return h; float getw()const return w; private:/新增私有数据成员 float w,h; };class Rectangle: public Point { //派生类定义部 分 public: //新增公有函数成员 void initRectangle(float x, float y, float w, float h) { initPoint(x, y); //调用基类公有成员函数 this->w = w; this->h = h; } float getH() const { return h; } float getW() const { return w; } private: //新增私有数据成员 float w, h; }; 15
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有