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

Can constructor be static in c++?

1114


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

1101


Why was c++ created?

1028


What's the "software peter principleā€?

1151


What does h mean in maths?

1212


Why cstdlib is used in c++?

1042


Define Virtual function in C++.

1095


Find the Factorial of a number using a program.

1005


What is the protected keyword used for?

1113


Write about the access privileges in c++ and also mention about its default access level?

1058


What is the use of structure in c++?

1038


Is c++ the best programming language?

1017


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2539


What is polymorphism explain its types?

1161


What does no cap mean?

1064