GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C++
Go To First  |  Previous Question  |  Next Question 
 C++  |  Question 113 of 203    Print  
what is virtual base class?

  
Total Answers and Comments: 4 Last Update: March 29, 2007     Asked by: snehasish banerjee 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 12, 2007 03:13:59   #1  
harithasri        

RE: what is virtual base class?
Actually virtual meaning is which doesnot exist in the real world. Here virtual base class means which has virtual member function but defined in derived class.
 
Is this answer useful? Yes | No
February 13, 2007 07:00:26   #2  
chinmay nayak        

RE: what is virtual base class?
virtual classes are generally used in hybrid inheritance for exp:Their are two classes B & C derived from publically from A and in turn a class D has been derived from class B & C so to avoid the inheritance of multiple copies of certain function in A into D through B & C virtual classes are used.
 
Is this answer useful? Yes | No
March 01, 2007 05:05:05   #3  
narsi        

RE: what is virtual base class?
It is very much useful in hybrid inheritence.

By declaring the class we can get only one copy of it when it was inherited.

 
Is this answer useful? Yes | No
March 29, 2007 09:15:48   #4  
dasam Member Since: March 2007   Contribution: 33    

RE: what is virtual base class?
If we are working with multiple inheritance it is always better to make the base class as virtual inorder to avoid the multiple copies of the base class data. :)
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape