What are pure virtual functions? Give a real-world example for abstract class and pure virtual function?
A pure virtual function is a virtual function that doesn’t require a definition in the base class. A pure virtual function is defined by writing =0 after its signature. The definition can be provided if some default behavior or error-handling is required. In some cases it’s not logical to instantiate an object of a class. In such cases, the concept of abstract classes can be made use of. To make a class abstract, the class needs to include at least one pure virtual function. For Example: Consider a class Employee that defines the generic behavior of different types of Employees that work in a company.