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

What is the use of volatile variable?

0 Answers  


the maximum length of a character constant can be a) 2 b) 1 c) 8

0 Answers  


What is difference c and c++?

1 Answers  


Do we have to use initialization list in spite of the assignment in constructors?

0 Answers  


What is an associative container in c++?

0 Answers  


differance between copy & clon

1 Answers   Microsoft,


What are inline functions?

3 Answers   Fidelity, Verizon,


Where do I find the current c or c++ standard documents?

0 Answers  


If there are two catch statements, one for base and one for derived, which should come first?

0 Answers  


Is it possible to get the source code back from binary file?

1 Answers  


What is a local variable?

0 Answers  


How to construct virtual constructor

6 Answers   CIStems Software, Symphony,


Categories