What is Pure Virtual Function? Why and when it is used ?
Answer Posted / shakti singh
A virtual function in a base class which is equated to 0 is called a pure virtual function.The class then is called a Abstract Base Class or in general ABC.No object of such class can be instantiated.ABC in general acts as an interface and implement the general flow of algorithm.A pure virtual function must be overloaded in the derived class otherwise the compiler will throw an error.
A pure virtual function do nothing and it is not concerned with the implementation detail.
| Is This Answer Correct ? | 13 Yes | 5 No |
Post New Answer View All Answers
What is isdigit c++?
Explain bubble sorting.
What is null pointer and void pointer and what is their use?
When should overload new operator on a global basis or a class basis?
What is the use of endl in c++?
Specify some guidelines that should be followed while overloading operators?
How can an improvement in the quality of software be done by try/catch/throw?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
Can a class be static in c++?
Explain function overloading and operator overloading.
Describe Trees using C++ with an example.
You want to link a c++ program to c functions. How would you do it?
What do you mean by funtion prototype?
What are the two types of polymorphism?
How did c++ start?