English
Language : 

CC78K4 Datasheet, PDF (210/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 10 LIBRARY FUNCTIONS
5-13 itoa,
ltoa,
ultoa
Utility Functions
FUNCTION
The string function itoa converts an int integer to its string equivalent.
The string function ltoa converts a long 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.
210
User’s Manual U15556EJ1V0UM