What is a pure virtual function?
Why is it represented as = 0...how is the internal
implementation for the same

Answers were Sorted based on User's Feedback



What is a pure virtual function? Why is it represented as = 0...how is the internal implementatio..

Answer / vikas

A pure virtual function makes a class abstract.0 is used in
its representation to distinguish it from a normal virtual
function. More at

http://www.cppquestions.com/viewtopic.php?f=26&t=14

Is This Answer Correct ?    3 Yes 0 No

What is a pure virtual function? Why is it represented as = 0...how is the internal implementatio..

Answer / helloworld

I believe pure virtual function is a member function with a
declaration as NULL;
virtual void fun()=0;
Now why zero,since the internal implementation of virtual
function is collection of function pointer ...we intialize
this value of function pointers as NULL.

Is This Answer Correct ?    3 Yes 0 No

What is a pure virtual function? Why is it represented as = 0...how is the internal implementatio..

Answer / viji

A virtual function with a null body is said to be pure
virtual function.
The pure virtual function can be defined later in its
derived class.......

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C++ General Interview Questions

I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

0 Answers  


Why c++ does not have finally?

0 Answers  


Name four predefined macros.

0 Answers  


what is importance of data sturture in a programming language?

22 Answers   L&T, TCS, Wipro,


Differentiate between declaration and definition.

0 Answers  






Distinguish between new and malloc and delete and free().

0 Answers  


What is the size of integer variable?

0 Answers  


Can we run c program in turbo c++?

0 Answers  


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

0 Answers  


Explain polymorphism?

0 Answers  


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

0 Answers  


Please post the model question paper of hal?

2 Answers  


Categories