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

How do I make turbo c++ full screen?

0 Answers  


What is different in C++, compare with unix?

0 Answers  


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

0 Answers  


What do you mean by internal linking and external linking in c++?

1 Answers  


How do you print for example the integers 3,2,1,5,4 in a binary tree within the console in format where it looks like an actual binary tree?

0 Answers  






What does flush do c++?

0 Answers  


What is java and c++?

0 Answers  


which is the easy way to divide any integer by 2?

2 Answers   Persistent,


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

0 Answers  


What is design pattern?

2 Answers   Samsung,


What is a rooted hierarchy?

0 Answers  


Why do we learn c++?

0 Answers  


Categories