|
class Circle:public Point
{
public:
Circle(float x=0,float y=0,float r=0);
void setRadius(float);
float getRadius()const;
virtual float area() const;
virtual void shapeName() const {cout<<"Circle";}
friend ostream&operator <<(ostream&,const Circle &);
protected:
float radius;
};
Circle::Circle(float x,float y,float r):Point(x,y),radius(r){}
void Circle::setRadius(float r):radius(r){}//这里就是问题所在
float Circle::getRadius() const{return radius;}
float Circle::area() const {return 3.14159*radius*radius;}
ostream&operator<<(ostream &output,const Circle &c)
{output<<"["<<c.x<<","<<c.y<<"]r="<<c.radius;
return output;
}
哪位大哥能帮我看看啊!
帖子名字就是dev-c++提示的错误
不好意思 没有说明白 |
|