I have a small issue with my code, but can't figure it out. When I call the overloaded operator+, everything is working well until i hit the return statement,which returns some garbage values. Can someone tell me what I am doing wrong please. I suspect it's something to do with the constructors.
The difference between assignment operator overloading and other operators overloading is that you have declared = operator overload as a member function, whereas all others are friend functions.
Hence you need to modify the properties of the current object in consideration referenced by *this.
If you make this as a friend function also, then perhaps (I'm not sure) your way might work.