Interview Questions   Tutorials   Discussions   Programs   Videos   

C++ - What is virtual class and friend class?

asked marvit August 19, 2014 07:41 AM  

What is virtual class and friend class?


1 Answers

answered By bhjahnavi   0  
virtual class:
Suppose you have two derived classes B and C that have a common base class A , and you also have another class D that inherits from B and C . You can declare the base class A as virtual to ensure that B and C share the same sub object of A .
friend class:
to access the private and protected members of the super class friend keyword is used .
   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!