What is a Pure Virtual Member Function ?
Whenever a virtual function in a base class is not redefined by the derived class then the version defined in the base class will be used. However in many cases it may so happen that there can be no meaningful definition of a virtual function within the base class. Or you may want to ensure that all derived classes override a virtual function. To handle both these cases the solution is a pure virtual function.
A pure virtual function is a function that has no definition in the base class. The definition of such a function is equal to 0.E.g. void draw () = 0; // this is a pure virtual function
If a class contains at least one virtual function then that class is called an abstract class and one cannot create an instance of an abstract class. Also if a class inherits from a class that contains a pure virtual function then the derived class has to provide a definition for the pure virtual function. Failure to do so will result in an abstract derived class.
