We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
A friend function is a function that can access the private members of a class as though it were a member of that class.
This is needed here because we're overloading operators, and we're accessing outside the class scope.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Box It!
You are viewing a single comment's thread. Return to all comments →
A friend function is a function that can access the private members of a class as though it were a member of that class. This is needed here because we're overloading operators, and we're accessing outside the class scope.