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
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
What is the keyword auto for?
Tell me can a pure virtual function have an implementation?
What is static function? Explain with an example
What is difference between n and endl in c++?
What is stack unwinding?
Can c++ be faster than c?
How do you flush a buffer in c++?
Define the operators that can be used with a pointer.
What is abstract keyword in c++?
Define a conversion constructor?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
Differentiate between a pointer and a reference with respect to c++.
What is oops in c++?
what kind of projects are suitable for c and c++