<<< Possible alternative: Faking it | Index | Pure virtual functions >>> |
Once a function is virtual in some base class, it is virtual in all descendant classes, whether labeled so or not:
class Shape { public: virtual void draw(); };//class Shape class Circle : public Shape { public: void draw(); // Still virtual };//class Circle
Use the virtual label in derived classes to avoid confusion!
<<< Possible alternative: Faking it | Index | Pure virtual functions >>> |