Friend Function in C++
A friend function in c++ is a function which is declared within a class and is defined outside the class. It does not require any scope resolution operator for defining . Friend Function can access private members of a class. It is declared by using keyword [friend]. The private members cannot be accessed from outside …