I am trying to derive class Smiley from Circle:
struct Smiley : Circle {
void draw_lines() const;
};
void Smiley::draw_lines() const {
Circle::draw_lines(); // outline
/*rest of code here*/
}
This is the definition of Circle:
struct Circle : Shape {
Circle(Point p, int rr); // center and radius
void draw_lines() const;
Point center() const;
void set_radius(int rr) { set_point(0, Point(center().x - rr, center().y - rr)); r = rr; }
int radius() const { return r; }
private:
int r;
};
I basically want a Circle with a couple arcs drawn on top. Theoretically, I should only have to write draw_lines()
over (which is defined as virtual
in Shape), but it does nothing without a constructor, and if I have a constructor, it get an error and says that Circle does not have a default constructor available, even if I have no code in the constructor relating to Circle.
Does anyone know why I am getting this error?