This function converts an unsigned integer to a null-terminated ASCII string. It accepts a pointer to a string buffer, a value to be converted to a string representation, and the radix in which to represent the number.
Radix may be one of the following:
Table 1. Radix options
radix | representation |
---|---|
2 | Binary |
8 | Octal |
10 | Decimal |
16 | Hexidecimal |
The string buffer must be long enough to contain all characters as follows:
Table 2. Required buffer sizes
representation | size |
---|---|
Binary | 9 bytes |
Octal | 4 bytes |
Decimal | 4 bytes |
Hexadecimal | 3 bytes |