Friend Class and Friend Function in C++
Friend Class: A friend class can access the private and protected members of other classes that have declared themselves friends. It can be useful to allow one class to access private members of another class. [sourcecode language=”plain”]your code here[/sourcecode] Example 1: Example 2: Friend Function: Like the friend class, this role can access private and …