c++多重继承

2025-02-02 07:45:10
推荐回答(1个)
回答1:

class Rectangle: private Point	//派生类声明
{
public:
void InitR(float x, float y, float w, float h) {Point::InitP(x,y); W = w; H = h;}
void Move(float xOff, float yOff) {Point::Move(xOff,yOff);}
float GetX() {return Point::GetX();}
float GetY() {return Point::GetY();}
float GetW() {return W;}
float GetH() {return H;}
private:
float W,H;
};