A pure virtual function is a function which is declared in a base class and which does not have definition relative to the base class. In such cases, the compiler requires each derived class to either defined in a derived class or is re-declared as pure virtual function. A pure virtual function in base class only serves as a placeholder. Such functions are also called as ‟do-nothing‟ functions.
Ex:-
class ABC
{
public:
virtual void display( )=0;
};
Rules:-
1. A pure virtual function in base class does not have definition relative to base class.
2. A class containing pure virtual functions cannot be used to declare any objects of its own.