User manual

Table Of Contents
650
mikoC PRO for PIC32
MikroElektronika
Description
The ags eld is where a single character is used to justify the output and to print +/- signs and blanks,
decimal points, and octal and hexadecimal prexes, as shown in the following table.
The width eld is a non-negative number that species the minimum number of printed characters.
If a number of characters in the output value is less than width, then blanks are added on the left or
right (when the - ag is specied) to pad to the minimum width. If width is prexed with 0, then zeros
are padded instead of blanks. The width eld never truncates a eld. If a length of the output value
exceeds the specied width, all characters are output.
conversion_type
Argument Type Output Format
d int
Signed decimal number
u unsigned int
Unsigned decimal number
o unsigned int
Unsigned octal number
x unsigned int
Unsigned hexadecimal number using
0123456789abcdef
X unsigned int
Unsigned hexadecimal number using
0123456789ABCEDF
f double
Floating-point number using the format [-]dddd.dddd
e double
Floating-point number using the format [-]d.dddde[-]
dd
E double
Floating-point number using the format [-]d.ddddE[-]
dd
g double
Floating-point number using either e or f format,
whichever is more compact for the specied value and
precision
c int
int is converted to an unsigned char, and the
resulting character is written
s char *
String with a terminating null character
p void *
Pointer value, the X format is used
% <none>
A % is written. No argument is converted. The complete
conversion specication shall be %%.
ags
Meaning
-
Left justify the output in the specied eld width.
+
Prex the output value with + or - sign if the output is a signed type.
s pa c e
(‘ ‘)
Prex the output value with a blank if it is a signed positive value. Otherwise, no blank is
prexed.
#
Prex a non-zero output value with 0, 0x, or 0X when used with o, x, and X eld types,
respectively. When used with the e, E, f, g, and G eld types, the # ag forces the
output value to include a decimal point. In any other case the # ag is ignored.
*
Ignore format specier.