sorry if i do some thing wrong posting that code ..
as have been said before there are more then two ways to aproach this :
1. to convert the strings to int then do math stuff on it;
2. to work on strings (like i did);
3. more options .
if you prefear to work with numbers and not chars
but be aware that numbers more then 32K will have to be dobule and not int.
so you probably will need to some cutting on the string
look on what i posted and work around that.
sorry if i misspell something (i don't know how to make my gcc warn my about English syntax errors ).