<<< Using virtual functions | Index | Under the covers >>> |
A pure virtual function is one which must be implemented in derived classes.
A class with a pure virtual function is called an abstract base class.
A class with a pure virtual function cannot be instantiated:
class Shape { public: virtual void draw() = 0; // pure virtual };//class Shape int main() { Shape sh; // Error, cannot create instance }
<<< Using virtual functions | Index | Under the covers >>> |