A friend function is a function that does not belong to a class but has access to its private and protected members. Friend functions are not class members; they are regular external functions with particular access permissions.
When private data from a class needs to be accessed directly without utilizing an object from that class, the friend function in C++ is utilized. Operator overloading is also done with friend functions. Operator overloading works similarly to function overloading in that it allows operators to be overloaded.
Additional functionality is provided outside of the class.
Provides functions for data that the class does not ordinarily use.
Allows sharing private class information by a non member function.
The course was very informative. and helpful. A few more exercises and less grammatical error on the notes could have made the course even better..
Deep Kumar Biswas
I love so much. I am grateful for making such an amazing site for all the common people. It has been very helpful to me. I can learn a lot from it. Thank you so much for creating such a site.Thank you
Share a personalized message with your friends.