I am trying to use an overloaded + operator to find the total balance for two values. I am messing up with the way to set them up, or forgetting something. I am getting values such as -9.543e2433
The code I am using for the operator is
Account operator+(Account &right)
{
Account temp;
int temp2;
temp2 = (savings + right.getchecking());
temp.setTotalBalance(temp2);
return temp;
}
I've looked for examples to see if I did it wrong, but from what I have looked at, it should have worked, unless I am not noticing something.
Any tips or suggestions on how I could go about fixing it would help me greatly.