English
Language : 

CC78K0S Datasheet, PDF (227/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
5-13 itoa
ltoa (normal model only)
ultoa (normal model only)
Utility Functions
FUNCTION
The string function itoa converts an int integer to its string equivalent.
The string function ltoa converts a long int integer to its string equivalent.
The string function ultoa converts an unsigned long integer to its string equivalent.
HEADER
stdlib.h
FUNCTION PROTOTYPE
char *itoa(int value,char *string,int radix);
char *ltoa(long value,char *string,int radix);
char *ultoa(unsigned long value,char *string,int radix);
Function
itoa,
ltoa,
ultoa
Arguments
value ... String to which
integer is to be converted
string ... Pointer to the
conversion result
radix ... Base of output string
Return Value
• Pointer to the converted
string if converted properly
• Null pointer if not converted
properly
EXPLANATION
itoa, ltoa, ultoa
• The itoa, ltoa, and ultoa functions all convert the integer value specified by value to its string equivalent
which is terminated with a null character and store the result in the area pointed to by “string”.
• The base of the output string is determined by radix, which must be in the range 2 through 36. Each function
performs conversion based on the specified radix and returns a pointer to the converted string. If the
specified radix is outside the range 2 through 36, the function performs no conversion and returns a null
pointer.
User’s Manual U14872EJ1V0UM
227