_ultoa, _ultow
Convert an unsigned long integer to a string. More secure versions of these functions are available; see _ultoa_s, _ultow_s.
char *_ultoa( unsigned long value, char *str, int radix ); wchar_t *_ultow( unsigned long value, wchar_t *str, int radix ); template <size_t size> char *_ultoa( unsigned long value, char (&str)[size], int radix ); // C++ only template <size_t size> wchar_t *_ultow( unsigned long value, wchar_t (&str)[size], int radix ); // C++ only
The _ultoa function converts value to a null-terminated character string and stores the result (up to 33 bytes) in str. No overflow checking is performed. radix specifies the base of value; radix must be in the range 2 – 36. _ultow is a wide-character version of _ultoa.
Security Note |
|---|
To prevent buffer overruns, ensure that the str buffer is large enough to hold the converted digits plus the trailing null-character. |
In C++, these functions have template overloads that invoke the newer, secure counterparts of these functions. For more information, see Secure Template Overloads.
TCHAR.H routine | _UNICODE & _MBCS not defined | _MBCS defined | _UNICODE defined |
|---|---|---|---|
_ultot | _ultoa | _ultoa | _ultow |
Routine | Required header |
|---|---|
_ultoa | <stdlib.h> |
_ultow | <stdlib.h> or <wchar.h> |
For additional compatibility information, see Compatibility in the Introduction.
Security Note