Damon McNeill wrote:Isn't there a String.format method that would do that
Only in Java®, and as you noticed, this is C code.
OP: You could consider a translation array
Remember that you can assign that “
String literal” to a
char[] or a
char* directly because of the way C handles text. But you need to assign space for a 0x11 (=17
decimal) size array to accommodate the final 0.
Find out whether you can use
i & 0x0f (maybe better as follows:-
i & 0x10 − 1) instead of the
% operator. Remember that the bitwise
and operator won't cause problems by giving you a negative result.