What is a 'pure' virtual function and what's its use?



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

Post New Answer

More C++ General Interview Questions

How many keywords are used in c++?

0 Answers  


write the programme that convert a interger to biniry number

1 Answers   Amazon,


What are pointer-to-members? Explain.

0 Answers   iNautix,


Which is not an ANSII C++ function a) sin() b) tmpnam() c) kbhit()

0 Answers  


Explain Memory Allocation in C/C++ ?

0 Answers   Infosys,






which is best institue to learn C/C++ IN AMEERPET OR MAITHRIVANAM OR SR NAGAR, PLEASE HELP. THANKS IN ADVANCE

5 Answers  


What is array give example?

0 Answers  


Explain the difference between static and dynamic binding of functions?

0 Answers  


Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D

1 Answers  


Can we get the value of ios format flags?

0 Answers  


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

0 Answers  


Which software is used for c++ programming?

0 Answers  


Categories