ultoa
raw OCR
Converts an unsigned long to a string.
Defined in header <stdlib.h>
Syntax
#include <stdlib.h>
char *ultoaCunsigned long value, char *string, int radix);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
ultoa converts value to a null-terminated string and stores the result in string, value is an unsigned long.
radix specifies the base to be used in converting value; it must be between 2 and 36, inclusive, ultoa performs no overflow checking, and if value is negative and radix equals 10, it does not set the minus sign.
b^
The space allocated for string must be large enough to hold the returned string, including the terminating null character (\0). ultoa can return up to 33 bytes.
Return value
ultoa returns string.
See also
Example
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
unsigned long Inumber = 3123456789L;
char string [25];
ultoa(lnumber,string,10) ;
printf("string = Is unsigned long = %lu\n",string,Inumber);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/stdlib.h/ultoa/
· short form /3.1/ultoa/