Why pure virtual functions are used if they don't have implementation / When does a pure virtual function become useful?



Why pure virtual functions are used if they don't have implementation / When does a pure virtua..

Answer / hrpynux@gmail.com

A pure virtual function makes it so the base class can not be instantiated, and the derived classes are forced to define these functions before they can be instantiated. This helps ensure the derived classes do not forget to redefine functions that the base class was expecting them to.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Explain deep copy and a shallow copy?

0 Answers  


What is ios in c++?

0 Answers  


Which is best c++ or java?

0 Answers  


Is it possible to use a new for the reallocation of pointers ?

0 Answers  


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

0 Answers  






Please post the model question paper of hal?

2 Answers  


What do c++ programmers do?

0 Answers  


Can I learn c++ without learning c?

0 Answers  


What are smart pointers?

0 Answers  


how many trys can we write in one class

3 Answers   Cap Gemini,


Why c++ is so important?

0 Answers  


What's the "software peter principle”?

0 Answers  


Categories