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 one dimensional array in c++?
What is c++ good for?
Can non-public members of another instance of the class be retrieved by the method of the same class?
What is a dynamic binding in c++?
What is the most powerful coding language?
Is c++ a good first language to learn?
What are the four partitions in which c++ compiler divides the ram?
What do you understand by zombie objects in c++?
What is pointer in c++ with example?
What is a constant? Explain with an example.
How many namespaces are there in c++?
What is the full form nasa?
Is recursion allowed in inline functions?
What is a syntax in c++?
What is the main purpose of c++?