Hello!
I'm trying to get my head around using the this pointer, and overloading c++ operators. So, can anyone please explain to me why the below two example pieces of code are incorrect?
1.
When overloading operator = you should be returning a reference. Also there is no need for a getter function. You can access the values directly. Generally speaking too when you call operator + it returns a copy not a modified value of the original you are mixing operator + and += up I think. So it should look something like: