printf.3s (2010 09)

p
printf(3S) printf(3S)
Otherwise, use style e formatting with formatting precision equal to n - 1.
Except if c = 0, then the digit-sequence in the exponent-part will have the
value q (rather than 0), and that the exponent is always expressed with the
minimum number of digits required to represent its value (the exponent never
contains a leading zero).
If the precision modifier is present and at least as large as the precision of the
decimal floating type, the conversion is as if the precision modifier were missing.
If the precision modifier is present and less than the precision of the decimal float-
ing type, the conversion first rounds the input, in the type, according to the current
rounding direction for decimal floating-point operations. The rounding occurs to the
number of digits specified by the precision modifier, then converts the result as if
the precision modifier were missing.
c The integer arg is converted to an unsigned char, and the resulting character is
printed. If an l (ell) qualifier is present, the
wchar_t arg is converted to an
array of bytes representing the single wide character according to the setting of
LC_CTYPE. Resulting bytes are printed. If the field width would otherwise cause
the wide character to be split, the wide character is printed and the field width is
adjusted upward.
_INCLUDE__STDC_A1_SOURCE
only: If an l (ell) qualifier is present, the
wint_t argument is converted as if by an ls conversion specification with no pre-
cision and an argument that points to a two-element array of type wchar_t, the
first element of which contains the wint_t argument to the ls conversion
specification and the second element contains a null wide-character.
C Same as lc.
s The arg is taken to be a string (character pointer) and characters from the string
are printed until a null character (\0) is encountered or the number of bytes indi-
cated by the precision specification is reached. If the precision is missing, it is
taken to be infinite, so all characters up to the first null character are printed. A
NULL value for arg yields undefined results.
If an
l (ell) qualifier is present, the argument must be a pointer to an array of type
wchar_t. Wide-characters from the array are converted to characters (each as if
by a call to the wcrtomb() function, with the conversion state described by an
mbstate_t object initialized to zero before the first wide-character is converted)
up to and including a terminating null wide-character. The resulting characters are
written up to (but not including) the terminating null character (byte).
If no precision is specified, the array must contain a null wide-character. If a preci-
sion is specified, no more than that many characters (bytes) are written (including
shift sequences, if any), and the array must contain a null wide-character if, to
equal the character sequence length given by the precision, the function would need
to access a wide-character one past the end of the array. In no case is a partial
character written.
S Same as ls.
p The value of a pointer to void arg is printed as a sequence of unsigned hexadecimal
numbers. The precision specifies the minimum number of digits to appear. If the
value being converted can be represented in fewer digits, it is expanded with lead-
ing zeros. The default precision is 1. The result of converting a zero value with a
precision of zero is a null string.
n A pointer to an integer arg is expected. This pointer is used to store the number of
bytes printed on the output stream so far by this call to the function. No argument
is converted.
% Print a %; no argument is converted. The entire conversion specification must be
%%.
In no case does a nonexistent or small field width cause truncation of a field; if the result of a conversion
is wider than the field width, the field is expanded to contain the conversion result.
4 Hewlett-Packard Company 4 HP-UX 11i Version 3: September 2010