Friend Function in C++

We know private members can not be accessed from outside the class. That is a non – member function can’t have an access to the private data of a class. In such situations, c++ allows the common function lo be made friendly with both the classes , there by following the function to have access to the private data of these classes .Such a function need not be a member of any of these classes. A class can grant any function a special permit for direct access to its private…

Read More