A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero. class Shape { public: virtual void draw() = 0; };
pure virtual means declaration of function with followed by virtual in base class. but the definition of the function is inside inherited class means derived class. whenver we want to extending the functionalities in derived class we inherited the same function name in derived class.
Pure virtual functions are used only when the programmer knows that the base class is not going to be used anyway.
When a function is declared as pure virtual, the compiler registers an entry for the function in to the VTABLE, but the address for the function is not mentioned in the VTABLE. So even if one function in a class is pure virtual, the VTABLE becomes incomplete. Since the VTABLE is incomplete, when we try to instantiate the class, the compiler returns error.
This helps for object Slicing as the programmer is never able to create object of the base class... So definitely it is not possible to pass the object of the base class into some other function (By Pass-by-Value).