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 Class and Structure?
40 Answers HP, IBM, Samsung, TCS,
Explain selection sorting. Also write an example.
Explain function overloading and operator overloading.
Differentiate between late binding and early binding. What are the advantages of early binding?
what is an array
You want to link a c++ program to c functions. How would you do it?
What is functions syntax in c++?
Explain the ISA and HASA class relationships. How would you implement each in a class design?
What is flush programming?
What is extern c++?
How many bit combinations are there in a byte?
How is modularity introduced in C++?