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

write the prime no program in c++?

16 Answers  


What is a terminating character in c++?

0 Answers  


What is static class data?

0 Answers  


Is there a new/delete equivalent of realloc?

1 Answers  


What are function poinetrs? where are they used?

1 Answers   CTS,






Write the program for fibonacci in c++?

20 Answers   TATA, Wipro,


What are references in c++?

0 Answers  


Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

0 Answers  


Explain shallow copy?

0 Answers  


how to swap two strings without using any third variable ?

11 Answers  


Explain Memory Allocation in C/C++ ?

0 Answers   Infosys,


How do I run a program in notepad ++?

0 Answers  


Categories