Hi,
A friend function is a special function in c++ which inspite of not being member fuction
of a class has privalage to access private and protected data of a class.
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.
A friend function is used for accessing the non-public members of a class.
A class can allow non-member functions and other classes to access its own
private data, by making them friends. Thus, a friend function is an ordinary
function or a member of another class.
To know more details, please refer to the link:
http://goo.gl/lX9E0
Answered by
Tushar Bhati
at
1:10 PM on July 31, 2012