Administrator
|
Look at the comment directly above "int2String(n):" where is says, "Convert a non-negative number to a string".
That's what that function does.
Remember that we don't print numbers to the screen, we print characters.
So if we want to print 257 to the screen, we have to first print the character that looks like '2', followed by the character that looks like '5', followed by the character that looks like '7'.
In memory, the integer 257 is '0000000100000001' (in binary).
From this, we need to get the character codes for '2' (which is the integer 50), '5' (which is the integer 53), and '7' (which is the integer 55).
The int2String function returns a string containing these character codes.
|