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...

What is a virtual base class?

Answer Posted / mukesh kumar

To Remove the ambguity problem in multiple inheritance we
make the base class as vitual that means it will make only
one copy its common data member.

EX: suppose we have a base class A , which have a data
member x as integer.

class b: virtual public A
{
};
class C : virtual public A
{
};
class d: public B,public C
{
}

without making classes A and B as virtual class d had two
copies of x.This will arised ambguity problem.

Is This Answer Correct ?    38 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What exactly is polymorphism?

1132


What does obj stand for?

1172


What is encapsulation in oops?

1015


Why do we use inheritance?

1132


Tell me an example where stacks are useful?

1037


Can I learn c++ without knowing c?

1065


What are disadvantages of pointers?

1040


Does c++ have finally?

1040


Explain this pointer?

1069


What is #include c++?

1137


What are the differences between the function prototype and the function defi-nition?

1101


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4749


What is operator overloading in c++ example?

1141


Why it is called runtime polymorphism?

1138


What is a c++ map?

1409