What is a 'pure' virtual function and what's its use?
Answer / phool chand
A pure virtual function is signified by using `=0;' in place of the body of the function. The presence of a pure virtual function prevents instantiation of the class which contains it. For this to be of any use, a derived class must implement the pure virtual function. I.e. the derived class must provide a function with the same name which includes a function body.
The basic reason for pure virtual functions is to specify something that a class can do without specifying how the class will do it.
| Is This Answer Correct ? | 0 Yes | 0 No |
Write a code/algo to find the frequency of each element in an array?
What is a manipulative person?
Define the process of handling in case of destructor failure?
Is dev c++ free?
What is the difference between global variables and local variable
Explain public, protected, private in c++?
How to implement flags?
What is the c++ code?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
What is pointer in c++ with example?
What is the difference between while and do while loop?