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
Explain dangling pointer.
What is difference between malloc()/free() and new/delete?
How compile and run c++ program in turbo c++?
What is the role of copy constructor in copying of thrown objects?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
Define a nested class. Explain how it can be useful.
Can constructor be private in c++?
How do I run c++?
What is vectorial capacity?
What is the difference between public, private, and protected access?
What is using namespace std in c++?
What is the best free c++ compiler for windows?
What do you mean by storage classes?
Can we use pointers in c++?
Can member data be public?