Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why do we use virtual functions?

Answers were Sorted based on User's Feedback



Why do we use virtual functions?..

Answer / uma sankar pradhan

we use virtual functions to achive dynamic binding
Dynamic binding is establishing relation between the
function call and function definition at run time

Is This Answer Correct ?    22 Yes 2 No

Why do we use virtual functions?..

Answer / bijal

The virtual function can be allowed in base classes only.
The functions markd Virtual will only be overridable in
derieved classes.
If i m having a function in base class that shud come in
derieved class but i want it to have different behaviour.
This can only be acheived only if base class function is
virtual function.

Is This Answer Correct ?    23 Yes 8 No

Why do we use virtual functions?..

Answer / td

A pure virtual member function is a member function that the
base class forces derived classes to
provide. Normally these member functions have no
implementation. Pure virtual functions are
equated to zero.
class Shape { public: virtual void draw() = 0; };

Is This Answer Correct ?    8 Yes 4 No

Why do we use virtual functions?..

Answer / mona kawale

when there are two same classes in derived and base class then at the tym of running programm compiler get confuse about which function should b call first so it call derived class function automatically....but if we wrote base class function as virtual function then compiler will not get confuse.....

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More OOPS Interview Questions

what is main difference between object oriented object base

2 Answers   Wipro,


what is a binary overloading

2 Answers  


What is the different between Applet and Application?

2 Answers  


What type of loop is a for loop?

0 Answers  


What is a scope operator and tell me its functionality?

3 Answers   emc2,


Which is the parameter that is added to every non-static member function when it is called?

3 Answers   Accenture,


What does it mean when someone says I oop?

0 Answers  


What is meant by multiple inheritance?

0 Answers  


how does a main() in C++ is different from main() in C?

7 Answers  


How do you use inheritance in unity?

0 Answers  


What is virtual function?where and when is it used?

2 Answers   Sitel,


What is polymorphism and types?

0 Answers  


Categories