Im having a really hard time understanding how this section of code works. I get everything in the program besides the adding part and it seems no matter how many time a re-read the section in my book or watch videos I simply dont get it. Please try to explain it as simple as possible.
Operator overloading is not much different from regular function overloading. It's just that the syntax is a bit more confusing.
An alternative way of writing yourAmount + myAmount is to write yourAmount.operator+(myAmount). Think of operator+ as being the function. yourAmount is the object that the function is called on. myAmount is the argument that is passed to the function.