Thursday 11 April 2013

Question: What is Pure Virtual Function? Why and when it is used ?


Question: What is Pure Virtual Function? Why and when it is used ?

Answer: The abstract class whose pure virtual method has to be implemented by all the classes which derive on these. Otherwise it would result in a compilation error.

This construct should be used when one wants to ensure that all the derived classes implement the method defined as pure virtual in base class.

No comments:

Post a Comment