Home / Object Oriented Programming / Define pure virtual function and Abstract class. When we need to use pure virtual function?

Define pure virtual function and Abstract class. When we need to use pure virtual function?

Pure virtual function is a virtual function that does not have body and that is required to be implemented by a desired class.

We need to use pure virtual function because it’s a way of telling the user of your class that they cannot use the class on its own. They must be inherited from it.