Download C Cross Compiler User's Guide for CORTEX-M

Transcript
C Library - printf
<precision> - a decimal number which specifies the minimum
number of digits to appear for d, i, o, u, x, and X conversions, the
number of digits to appear after the decimal point for e, E, f and r conversions, the maximum number of significant digits for the g and G
conversions, or the maximum number of characters to be printed from a
string in an s conversion. The precision takes the form of a period followed by a decimal digit string. A null digit string is treated as zero.
h - optionally specifies that the following d, i, o, u, x, or X conversion
character applies to a short int or unsigned short int argument (the argument will have been widened according to the integral widening conversions, and its value must be cast to short or unsigned short before
printing). It specifies a short pointer argument if associated with the p
conversion character. If an h appears with any other conversion character, it is ignored.
l - optionally specifies that the d, i, o, u, x, and X conversion character
applies to a long int or unsigned long int argument. It specifies a long or
far pointer argument if used with the p conversion character. It specifies
a long _Fract if used with the r conversion character. If the l appears
with any other conversion character, it is ignored.
L - optionally specifies that the following e, E, f, g, and G conversion
character applies to a long double argument. If the L appears with any
other conversion character, it is ignored.
<conversion character> - character that indicates the type of conversion to be applied.
A field width or precision, or both, may be indicated by an asterisk ‘*’
instead of a digit string. In this case, an int argument supplies the field
width or precision. The arguments supplying field width must appear
before the optional argument to be converted. A negative field width
argument is taken as a - flag followed by a positive field width. A negative precision argument is taken as if it were missing.
The <flags> field is zero or more of the following:
space - a space will be prepended if the first character of a signed conversion is not a sign. This flag will be ignored if space and + flags are
both specified.
© 2012 COSMIC Software
Using The Compiler 131