ultoa converts an unsigned long -- utoa converts an unsigned integer to a null-terminated string and stores it, without overflow checking.
#include <stdlib.h> char *utoa(unsigned int value, char *string, int radix); char *ultoa(unsigned long value, char *string, int radix); #include <wchar.h> wchar_t *_utow(unsigned int value, wchar_t *string, int radix); wchar_t *_ultow(unsigned long value, wchar_t *string, int radix);
value
string
radix
The string buffer must be large enough to accommodate the largest representation of a long integer that radix
calls for. For example, on an RT system, the largest signed values represented in a 32-bit integer are -2,147,483,648 and +2,147,483,647. In base 2, their binary representations are 1 and thirty-one trailing 0s, and 0 and thirty-one trailing 1s, respectively. With the sign and terminating null character, the minimum buffer size would be thirty-four bytes for binary representation.
For portability, use sprintf 's %lo, %ld, or %lx conversion specifiers, if radix
is 8, 10, or 16, when calling ultoa. Use sprintf's %o
, %d
, or %x
conversion specifiers, if radix
is 8, 10, or 16, when calling utoa.
With radix
greater than 10, digits in the converted string representing values 10 through 35 are the characters a through z.
tchar.h routine |
_UNICODE not defined |
_UNICODE defined |
---|---|---|
_utot | utoa | _utow |
_ultot | ultoa | _ultow |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 INtime 6.0 (for wide-character and generic text versions) |
intime/rt/include/stdlib.h intime/rt/include/wchar.h intime/rt/include/tchar.h |
stdlib.h wchar.h tchar.h |
clib.lib |