C++ Beginner - 'friend' functions and << operator overloading: What is the proper way to overload an
- by Francisco P.
Hello, everyone!
In a project I'm working on, I have a Score class, defined below in score.h. I am trying to overload it so, when a << operation is performed on it, _points + " " + _name is returned.
Here's what I tried to do:
ostream & Score::operator<< (ostream & os, Score right)
{
os << right.getPoints()…