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
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
What is a virtual destructor? Explain the use of it?
Do you know what are static and dynamic type checking?
Is c++ still in demand?
What is the use of main function in c++?
How would you use the functions randomize() and random()?
Explain the volatile and mutable keywords.
What information can an exception contain?
Define the operators that can be used with a pointer.
How much do coding jobs pay?
What is the use of structure in c++?
What is the real purpose of class – to export data?
Explain the scope of resolution operator.
How to give an alternate name to a namespace?
What is the difference between global int and static int declaration?