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

What is a local variable?

0 Answers  


How do you define a class in c++?

0 Answers  


Difference between strdup and strcpy?

0 Answers  


When should we use multiple inheritance?

0 Answers  


Write a String class which has: 1) default constructor 2) copy constructor 3) destructor 4) equality operator similar to strcmp 5) constructor which takes a character array parameter 6) stream << operator

2 Answers   HCL, Lehman Brothers, Zoomerang,






What is a hash function c++?

0 Answers  


write a programme to get a character and thier ASCII value

0 Answers  


What is the role of C++ shorthand's?

0 Answers   TCS,


What is the rule of three?

0 Answers  


What does new do in c++?

0 Answers  


How a new element can be added or pushed in a stack?

0 Answers  


What is a Default constructor?

1 Answers  


Categories