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
What is the real purpose of class – to export data?
Define basic type of variable used for a different condition in C++?
What are the various storage classes in C++?
What does new return if there is insufficient memory to make your new object?
What are mutator methods in c++?
Why do we need runtime polymorphism in c++?
What is near, far and huge pointers? How many bytes are occupied by them?
Is C++ case sensitive a) False b) Depends on implementation c) True
Is it possible to provide special behavior for one instance of a template but not for other instances?
Which software is best for c++ programming?
What is using namespace std in cpp?
Show the declaration for a static member variable.
What is the difference between equal to (==) and assignment operator (=)?
Is c++ low level?
Is linux written in c or c++?