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 |
Explain terminate() and unexpected() function?
What do you know about friend class and friend function?
When should we use container classes instead of arrays?
What is the use of endl?
What are signs of manipulation?
What is a multiset c++?
What is decltype c++?
Why is swift so fast?
Is python written in c or c++?
What is an explicit constructor?
write a program that a 5 digit number and calculates 2 power that number and prints it.
2 Answers Vimukti Technologies,
What is struct c++?