Pure virtual function are virtual function with no definition.
virtual void func()=0;
Class with atleast one pure virtual is made as abstract class. Classes that inherit the abstract class must provide the definition to the pure virtual function.
What happens when we create a pure virtual function ?
When we create a pure virtual function in abstract class, we reserve slot for that function in the VTABLE(virtual table, maintained by the compiler), but doesnt put any address in that slot. So the VTABLE will be incomplete.Since the VTABLE for the abstract class is incomplete, compiler will not allow the creation of the object and will throw an error.
Pure Virtual Definitions:
These pure virtual functions can have definition in abstract class, which we want all the derived class to have. These definitions should be provided outside the class definition.
What does pure virtual function mean ?
When a function is declared pure virtual function, it cannot be called dynamically through a virtual dispatch mechanism.But it can be called statically without virtual dispatch. So, yes. Pure virtual functions can have definition. But it makes the class abstract without completing the VTABLE.