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

How should runtime errors be handled in c++?

1199


an integer constant must have atleast one a) character b) digit c) decimal point

1079


What is object and example?

1226


What is the best c++ ide?

1236


What is difference between data abstraction and encapsulation?

1128


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

1159


What is a list c++?

1156


What is the main purpose of c++?

1107


What is the full form of dos?

1245


How many static variables are created if you put one static member into a template class definition?

1088


Explain method of creating object in C++ ?

1155


Do you know the use of vtable?

1189


Explain the difference between c & c++?

1139


What is the maximum combined length of command line arguments including the space between adjacent arguments?

1039


What is virtual base class?

1131