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 are the main features of c++?
How would you find out if a linked-list is a cycle or not?
What is the meaning of string in c++?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
Explain terminate() and unexpected() function?
What is the use of namespace std in C++?
What is the difference between public, private, and protected access?
What is using namespace std in c++?
What is the best way to declare and define global variables?
Is there finally in c++?
Can you please explain the difference between overloading and overriding?
What flag means?
What is microsoft c++ redistributable 2013?
How does the copy constructor differ from the assignment operator (=)?
Describe delete operator?