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 |
what is oops and list its features in c++?
What is the difference between passing by reference and passing a reference?
What is atoi?
When should we use container classes instead of arrays?
What is an ABC: an "Abstract Base Class"?
Is recursion allowed in inline functions?
Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].
What are the stages in the development cycle?
Do vectors start at 0 c++?
What is lambda in c++?
How do I get good at c++ programming?
Explain container class.