statement has four parts:
for (a ; b ; c )
is executed before the loop starts
is executed after the loop has run
is tested after c has executed
is executed each time the loop runs.
In pseudo code it looks like this:
2) If ( not
) goto (3)
2.3) Goto (2)
So in your case:
1) Subtract one from
2) if ( digit < 0 ) exit the loop.
2.1) Execute these lines:
nextDigit = convertedNumber[digit];
printf ("%c", baseDigits[nextDigit]);
2.2) Subtract one from
2.3) Loop round to (2) and check again.
The other code fragment is simple:
is an array, and your code
extracts the element at the position given by the index value in
- so if the index is zero, it fetches the first character '0', if it's one it fetches '1', and so on up to fourteen 'E' and fifteen 'F'
You wrote this code for your homework, so you should really understand what it does...