English
Language : 

CC78K0S Datasheet, PDF (196/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
sprintf (normal model only)
I/O Functions
The format codes for output conversion specifications are as follows,
d ................... Converts int argument to signed decimal format.
i .................... Converts int argument to signed decimal format.
o ................... Converts int argument to unsigned octal format.
u ................... Converts int argument to unsigned decimal format.
x ................... Converts int argument to unsigned hexadecimal format (with lowercase letters abcdef).
X................... Converts int argument to unsigned hexadecimal format (with uppercase letters ABCDEF).
With d, i, o, u, x and X type specifiers, the minimum number of digits (minimum field width) of the result is
specified. If the output is shorter than the minimum field width, it is padded with zeros. If no precision is
specified, 1 is assumed to have been specified. Nothing will appear if 0 is converted with 0 precision.
f .................... Converts double argument as a signed value with [-] dddd.dddd format.
dddd is one or more decimal number(s). The number of digits before the decimal point is
determined by the absolute value of the number, and the number of digits after the decimal
point is determined by the required precision. When the precision is omitted, it is interpreted
as 6.
e ................... Converts double argument as a signed value with [-] d.dddd e [sign] ddd format. d is one
decimal number, and dddd is one or more decimal number(s). ddd is exactly a three-digit
decimal number, and the sign is + or –. When the precision is omitted, it is interpreted as 6
E................... The same format as that of e except E is added instead of e before the exponent.
g ................... Uses whichever shorter method of f or e format when converting double argument based on
the specified precision. e format is used only when the exponent of the value is smaller than –
4 or larger than the specified number by precision.
The following 0s are truncated, and the decimal point is displayed only when one or more
numbers follow.
G .................. The same format as that of g except E is added instead of e before the exponent.
c ................... Converts int argument to unsigned char and writes the result as a single character.
s ................... The associated argument is a pointer to a string of characters and the characters in the string
are written up to the terminating null character (but not included in the output). If precision is
specified, the characters exceeding the maximum field width will be truncated off the end.
When the precision is not specified or larger than the array, the array must include a null
character.
p ................... The associated argument is a pointer to void and the pointer value is displayed in
hexadecimal 4 digits (with 0s prefixed to less than a 4-digit pointer value). The precision
specification if any will be ignored.
n ................... The associated argument is an integer pointer into which the number of characters written
thus far in the string “s” is placed. No conversion is performed.
% .................. Prints a % sign. The associated argument is not converted (but the flag and minimum field
width specifications are valid).
196
User’s Manual U14872EJ1V0UM