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 the best book for c++ beginners?
Why c++ is faster than java?
What does it mean to declare a destructor as static?
You run a shell on unix system. How would you tell which shell are you running?
Show the application of a dynamic array with the help of an example.
What are guid? Why does com need guids?
Why are pointers not used in c++?
what is scupper?
describe private access specifiers?
What are the steps in the development cycle?
Explain the benefits of proper inheritance.
What is pointer in c++ with example?
What is ofstream c++?
What is a loop? What are different types of loops in c++?
How is new() different from malloc()?