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 is time h in c++?

1077


What do stl stand for?

1069


What is a modifier in c++?

1078


When did c++ add stl?

1172


How do you declare A pointer to function which receives an int pointer and returns a float pointer

1116


Why do we need constructors in c++?

1057


Is set c++?

953


Differentiate between C and C++.

1169


What is recursion?

1927


Tell us the size of a float variable.

992


Explain selection sorting. Also write an example.

981


What is c++ iterator?

1052


What is problem with overriding functions?

1003


What do you understand by zombie objects in c++?

1037


What are the advantages/disadvantages of using inline and const?

1032