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 latest version on c++?
What is iomanip c++?
What's the order in which the local objects are destructed?
What is optimization in c++? when using volatile.optimization is not possible..what does this mean?
Can we specify variable field width in a scanf() format string? If possible how?
What are the five basic elements of a c++ program?
sizeof - is it a function or operator?
how to create window program in c++.please explain.
When you overload member functions, in what ways must they differ?
can output 5 students using one dimensional array
What is protected inheritance?
What is volatile and pragma? When they are used?