Point.h:6: 错误:return type specification for constructor invalid
Point.h
#ifndef POINT_H#define POINT_Hclass Point{public: void Point(float xx=0,float yy=0) { x=xx; y=yy; } void Move(float xOff,float yOff){ x+=xOff; y+=yOff; } float getX(){return x;} float getY(){return y;}private: float x,y;};class Rectangle:public Point{public: void initR(float x,float y,float w,float h){ Point(x,y); W=w; H=h; } float getH(){return H;} float getW(){return W;}private: float W,H;};#endif // POINT_H#include <iostream>#include <Point.h>using namespace std;int main(){ Rectangle rect; rect.initR(2,30,20,10); rect.Move(3,2); cout<<rect.getX()<<',' <<rect.getY()<<',' <<rect.getH()<<',' <<rect.getW()<<endl; return 0;}E:\project\test-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK____\..\..\QtProject\test\main.cpp:2: In file included from ..\..\QtProject\test\main.cpp:2:E:\project\test-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK____\..\..\QtProject\test\Point.h:6: 错误:return type specification for constructor invalid