A friend function is a non member function of a class, that is declared as a friend using the keyword "friend" inside the class. By declaring a function as a friend, all the access permissions are given to the function.
Friend function allows the functions of outside class to access the private data members and member functions of another class.It can be achieved by prefixing them with the keyword friend...
Friend function can also be used in operator overloading if the operator in applied on objects of the different class. For example:
cout<<Number;
cout is in built object and Number is object of the user defined class. To overload the operator "<<" we need to declare the operator function (operator<<) as friend function of the Number object calss.