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 the difference between a template and a macro?
What is a static member?
What parameter does the constructor to an ofstream object take?
Is there any difference between dlearations int* x and int *x? If so tell me the difference?
What is c++ best used for?
Explain the difference between class and struct in c++?
what is C++ exceptional handling?
What are the rules for naming an identifier?
What is #include iomanip?
explain the reference variable in c++?
In which memory a class gets stored(in heap /in stack)? And why??
Define the operators that can be used with a pointer.