Why pure virtual functions are used if they don't have implementation / When does a pure virtual function become useful?
Answer Posted / 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 View All Answers
an integer constant must have atleast one a) character b) digit c) decimal point
What is a v-table?
What is polymorphism & list its types in c++?
What is a manipulative person?
What are all predefined data types in c++?
What does it mean to declare a member variable as static?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
How many standards of c++ are there?
What is double in c++?
What is insertion sorting?
Is c++ a programming language?
How do you print a string on the printer?
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
What are the implicit member functions of class?
What is the keyword auto for?