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 are references in c++?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
What are the vectors in c++?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
Define copy constructor.
What is c++ virtual inheritance?
What are the c++ access specifiers?
What is pure virtual function?
What is a container class? What are the types of container classes in c++?
What is implicit conversion/coercion in c++?
Name the operators that cannot be overloaded in C++?
What is the header file for setw?
Is java easier than c++?
Define virtual constructor.
What are the types of pointer?