Tried making my addition for strings ... lots of struggle thus far
and dev c++ isn't really helping with its debugger needing some debugging of its own.
any ideas? the program always returns 1 (from the 2nd to last statement)
(convertInt accepts an int and returns it as a string)
string addition(string num1,string num2)
string total = "";
//I want the larger digit number on the top row, just as I would on paper.
if(num1.length() < num2.length())
string temp = num1;
num1 = num2;
num2 = temp;
numSize = num1.length();
//add zeros so they now match in length...so I can simply go from right to left adding cols.
while(numSize != num2.length())
num2= "0" + num2;
for(int i = numSize-1; i >= 0; --i)
//Here I attempt to add characters together and resolve an integer
if(sum = (int)num2[i]+(int)num1[i]+carry > 9)
//when adding, the carry is at most 1.
carry = 1;
total=(convertInt(sum - 10))+total;
total = convertInt(sum) + total;
(carry == 1) ? total = "1" + total : 0;