Friend Class
All private or protected members can not be accessed from outside of the declared class. If we want a declared class having ability to access private or protected members. We can specify the class as a friend of other.
If a friend class B is defined as a friend of a class A then an object of the class B can access all members of the friend object of the class A.
Why ?
The friend class concept is used to implement easily to manage visibility between two classes.
In Java, C#, we can think this concept is similar the inner class concept.