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 / atul jawale

Virtual base class is a base class acts as an indirect base
for more than one without duplication of its data members.

A single copy of its data members is shared by all the base
classes that use it as a virtual base.

For example:
A
/ \
B C
\ /
D

class A { /* ... */ }; // indirect base class
class B : virtual public A { /* ... */ };
class C : virtual public A { /* ... */ };
class D : public B, public C { /* ... */ }; // valid

Using the keyword virtual in this example ensures that an
object of class D inherits only one subobject of class A.

Is This Answer Correct ?    75 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain the term 'resource acquisition is initialization'?

887


What is object-oriented programming? Webopedia definition

1178


What is pointer to member?

1012


Why is c++ a mid-level programming language?

963


What is ifstream c++?

978


What is abstraction c++?

946


Is it possible to provide special behavior for one instance of a template but not for other instances?

1057


What parameter does the constructor to an ofstream object take?

1003


What is static in c++?

1005


Name the debugging methods that are used to solve problems?

1036


What is abstraction with real time example?

1101


What are the benefits of oop?

1165


What is stl stand for?

1162


What is helper in c++?

1035


what is a pragma in C++?

1058