class Shape // an abstract class { public: Shape(); private: void init(); virtual void reset() = 0; int _color; }; Shape::Shape() { init(); } void Shape::init() { reset(); } class Point : public Shape // a concrete derived class { public: virtual void reset(); // ... private: double _x, _y; }; void Point::reset() { _x = _y = 0; } int main() { Point p; }