sorry if i do some thing wrong posting that code ..

anyway ..
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

[Qoute]
(int) char_varibale
[/Qoute]

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.

p.s.
sorry if i misspell something (i don't know how to make my gcc warn my about English syntax errors ).