Friend Function:- Friend Function is Friendly to all the classes which can be declared as a friend of that class. "Friendship is given not taken" this statement means to say the friend is always declared by the class it self. when any class can use friend keyword in front of any non member function that function can access all it's private data member as well as member functions. The below code will show you the implementation of friend keyword.
friend void display(A);
cout<<"Enter the Name:=";
void display(A a)
In above code display function is not a member function of Class A but Class A can be declared display function as friend using friend keyword in front of that function. So display function can be access all the Private things of Class A.