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 |
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
How to create a reference variable in C++
What is the advantage of an external iterator.
What is an explicit constructor?
What is a .h file c++?
What is the function to call to turn an ascii string into a long?
What is the c++ programming language used for?
How to construct muliton object
Differentiate between an inspector and a mutator ?
What is a multiset c++?
Why null pointer is used?
What does new return if there is insufficient memory to make your new object?