Why pure virtual functions are used if they don't have implementation / When does a pure virtual function become useful?
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 |
Can member functions be private?
What is a float in c++?
Which format specifier is used for printing a pointer value?
What is the difference between structures and unions?
What is the header file for setw?
How can I improve my c++ skills?
What is the purpose of templates in c++?
What is a pdb file?
Is c++ the most powerful language?
What is "mutable" keyword?
Do class declarations end with a semicolon? Do class method definitions?
What is a storage class?