+ 10
I would know the difference between friend class and inhertnce class??
2 ответов
+ 2
They really have nothing to do with one another.
Inheritance means that all instances of child class are also instances of superclass.
The friend keyword makes private members accessible to the friend.
+ 1
structure has no inhertance relativity.
inhertance represetived in cpp by:
- class, has (three access control layers):
- public
- private
- protected
however, friend is a property which would be could be added to another class. so, the second class with friend prevelge has a full access to the first class's content even if the first class has an access control layers