Difference Between Friend Function and Member Function
A Friend function is a function defined outside the class, but it has access to all private and protected members of the class. To declare a friend function, it’s prototype must be declared inside the class, preceding it with keyword “friend”. Check Friend Function for more information.
A Member function is a function defined in the class as a member of the function. It is usually declared inside the class definition.