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 arrays c++?
What is fflush c++?
Explain what are accessor methods?
What is the output of the following program? Why?
What is a lambda function c++?
Define token in c++.
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
Does c++ have string data type?
Is c++ the hardest programming language?
Will this c++ program execute or not?
How to implement is-a and has-a class relationships?
What is dev c++ used for?
How static variables and local variablesare similar and dissimilar?
How can you differentiate between inheritance and implementation in c++?
Describe the advantage of an external iterator.