Format
#include <stdlib.h> char *_ulltoa(unsigned long long value, char *string, intradix);
Language Level: Extension
_ulltoa converts the digits of the given unsigned
long long value to a null-terminated character string
and stores the result in string. The radix
argument specifies the base of value; it must be in
the range of 2 through 36.
The space allocated for string must be large enough to hold the returned string. The function can return up to 65 bytes, including the null character (\0).
Return Value
_ulltoa returns a pointer to string.
There is no error return value.
Example
This example converts the digits of the
value 255 to decimal, binary, and hexadecimal representations.
#include <stdio.h> #include <stdlib.h>
int main(void)
{
char buffer[10];
char *p;
p = _ulltoa(255ULL, buffer, 10);
printf("The result of _ulltoa(255) with radix of 10 is %s\n", p);
p = _ulltoa(255ULL, buffer, 2);
printf("The result of _ulltoa(255) with radix of 2 is %s\n", p);
_ulltoa(255ULL, buffer, 16);
printf("The result of _ulltoa(255) with radix of 16 is %s\n", buffer);
return 0;
/**********************************************************************
The output should be:
The result of _ulltoa(255) with radix of 10 is 255
The result of _ulltoa(255) with radix of 2 is 11111111
The result of _ulltoa(255) with radix of 16 is ff
**********************************************************************/
}
![]()
_ecvt -- Convert
Floating-Point to Character
_fcvt -- COnvert
Floating-Point to String
_gcvt -- Convert
Floating-Point to String
_itoa -- Convert
Integer to String
_ltoa -- Convert
Long Integer to String
_ultoa -- Convert
Unsigned Long Integer to String
<stdlib.h>