Friend Function and Friend Class
Friend function and friend classes are used to access private and protected data members of any class in which it is declared as Friend.
Friend function vs Friend class
What is friend function in cpp ?
Any function which is declared as friend in another class is called friend function.
What are friend classes in cpp ?
Friend Class is similar to Friend Function which also can access private and protected data variables of another class.
Too much friend functions and friend classes can lessen encapsulation, which is a very important Object Oriented Programming Feature. Encapsulation is related to showing only relevant data and hiding all data related to implementation.