Ok for starters the numbers need to be signed, which means they can be negatives.
so say in the case of add, if we have -5(a) + 6(b) = 1 (c)
So your going to have to have a check for character @ 0, to make sure it's a minus (-) or anything else will be a plus. with addition your going to have to add each element in the array backwards, I mean from the last element. for example:
However if we just added each first element we would get something silly like
161
, as you can only store the 1 character in each char variable.
So you need to convert each element to int, to do the calculation store in a temporary variable, if number is above 10, then we will have to store the second digit in the char and then divide the number by 10 and add that to the next set of characters.
So in the case of the above calculation 7+9=16, store the 6 in the char, and add the 1 to the next set which is (3+3=6)+1=7, 7 there is not above 10, so we store that and move onto the next...
//----------------------------------------------
What I don't get about the assignment is if you have a 64 digit number that is all 99999's and add that to another 64digit that is all 999's, how do you end up with a 64digit number?
Can anyone speculate on this ? I'm guessing we just say too bad, and cut off the rest of the number.