class Object {
public:
Object(int id_) : id(id_) {}
virtual ~Object() {}
private:
int id;
};
class Point: public Object {
public:
Point(double x_, double y_, int id_)
: Object(id_), x(x_), y(y_) {}
private:
double x, y;
};
class Circle: public Point {
public:
Circle(double x_, double y_, double r_, int id_)
: Point(x_, y_, id_), r(r_) {}
private:
double r;
};
int test(Object *obj)
{
return 0; // <== break point here
}
int main()
{
test(new Circle(1.5, -2.5, 3.0, 15));
return 0;
}
class Object {
public:
Object(int id_) : id(id_) {}
virtual ~Object() {}
private:
int id;
};
class Point: public Object {
public:
Point(double x_, double y_, int id_)
: Object(id_), x(x_), y(y_) {}
private:
double x, y;
};
class Circle: public Point {
public:
Circle(double x_, double y_, double r_, int id_)
: Point(x_, y_, id_), r(r_) {}
private:
double r;
};
int test(Object *obj)
{
return 0; // <== break point here
}
int main()
{
test(new Circle(1.5, -2.5, 3.0, 15));
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks