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 #include iomanip?
Which programming language should I learn first?
What is helper in c++?
How a modifier is similar to mutator?
How important is c++?
What is new in c++?
What is ios in c++?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
If a header file is included twice by mistake in the program, will it give any error?
What is java and c++?
Can we make copy constructor private in c++?
How did c++ start?
What are virtual constructors/destructors?
What are protected members in c++?
What is the difference between passing by reference and passing a reference?