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 extension of c++?
What are the advantages of prototyping?
What is null pointer and void pointer?
What data encapsulation is in c++?
What is the use of :: operator in c++?
How do you clear a set in c++?
Define Virtual function in C++.
What is the header file for setw?
Is python written in c or c++?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
Why is c++ so fast?
Which software is best for programming?
Write about the role of c++ in the tradeoff of safety vs. Usability?
What is meant by a delegate?
Is C++ case sensitive a) False b) Depends on implementation c) True