_ultoa, _ultow
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at _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
Parameters
value
Number to be converted.
str
String result.
radix
Base of value.
Each of these functions returns a pointer to str. There is no error return.
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.
To prevent buffer overruns, ensure that the |
In C++, these functions have template overloads that invoke the newer, secure counterparts of these functions. For more information, see Secure Template Overloads.
Generic-Text Routine Mappings
| 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.
See the example for _itoa.
Data Conversion
_itoa, _i64toa, _ui64toa, _itow, _i64tow, _ui64tow