I would also agree that there is no need to cast since the characters already have integer values in the ascii table.
I'm going to try and clarify what Uj is doing here a little to see if it helps.
First step:
Look at the ascii table and determine the values for the characters 1,2,3,4,5
Second step:
Still looking at the ascii table find a value that if you subtract the char values of 1,2,3,4,5 by it you will get the integers 1,2,3,4,5;
Ex: char value of 1 - 'some value' = 1
Step Three:
After you have found those values look closely at the way Uj expanded the number 12345 in his earlier post and see if you can build an integer from that.
i.e.
uj nossnahoj wrote:
Check out this formula,
int n = 1*10000 + 2*1000 + 3*100 + 4*10 + 5;
and figure out how you go from "12345" to there.
Hope this helps,
Hunter