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 the header file for setw?
Distinguish between a # include and #define.
Define a pointer to a data member of the type pointer to pointer?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101
How static variables and local variablesare similar and dissimilar?
What's the hardest coding language?
How can you link a c program with a c function?
Can we get the value of ios format flags?
Why c++ is better than c language?
What is size of string in c++?
Can we overload operator in c++?
What is a storage class?
What does new in c++ do?
Define macro.
How the keyword struct is different from the keyword class in c++?