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 c++ try block?
If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?
write a c++ program that gives output 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 using looping statement
Write about c++ storage classes?
What are compilers in c++?
Write a corrected statement in c++ so that the statement will work properly. x + y=z;
What are the difference between reference variables and pointers in C++?
What is split a string in c++?
What do you mean by delegate? Can a user retain delegates?
What is a tuple c++?
What is the arrow operator in c++?
What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00