What is Pure Virtual Function? Why and when it is used ?
Answer Posted / prajesh gupta (ferozepur, punj
Pure Virtual Functions:
1. "Do nothing Function"
virtual void display() = 0;
2. declared in base class.
3. class containing a pure virtual function does not
declare an object of its own. (That class is known as
ABSTRACT CLASS)
Advantages Of Using:
1. To inherit the properties of the derived class.
2. To create a base pointer required for runtime
poymorphism.
3. To avoid overwriting of member function.
| Is This Answer Correct ? | 37 Yes | 11 No |
Post New Answer View All Answers
What is a storage class?
Should I learn c or c++ first?
Is sorted c++?
Is set c++?
Why cstdlib is used in c++?
What do you mean by inheritance in c++?
What is the difference between containment and delegation?
Explain operator overloading.
Is c++ still being used?
What is object in c++ wikipedia?
Why are pointers not used in c++?
what is data abstraction in C++?
How do you traverse a btree in backward in-order?
What do you mean by persistent and non persistent objects?
What are all predefined data types in c++?