Interview Questions   Tutorials   Discussions   Programs   Videos   

C++ - What is Pure Virtual Function? Why and when it is used ?




473
views
asked marvit August 19, 2014 12:26 AM  

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


           

1 Answers



 
answered By bhjahnavi   0  
Pure Virtual Function
A pure virtual function is a function whose definition is not done at present but the programmer feels that it will be useful in the further classes
A pure virtual function is a function that has the notation "= 0" in the signature of that function. 
use of pure virtual function:
It is actually pretty rare to see a pure virtual function with an implementation in real-world code, but having that implementation may be desirable when you think that classes which derive from the base class may need some sort of default behavior for the pure virtual function. 
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert