+ 1
Usually, friend overloading is used for the << or the >> to bind our objects to a stream so that we can use cin, cout or any other stream to receive and display input/output. The reason this is done is as the <</>> operator must belong to the ostream/istream class, and we need them to be able to access the private members of the class we are overloading the operators for to perform input/output. Thus, we use friend operators.
5th Feb 2018, 4:48 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar