HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)

f
fwprintf(3C) fwprintf(3C)
X Behaves the same as the x
conversion wide-character except that letters
ABCDEF are used
instead of
abcdef.
f The double argument is converted to decimal notation in the style [-]ddd.ddd, where the
number of digits after the radix character is equal to the precision specification. If the pre-
cision is missing, it is taken as 6; if the precision is explicitly 0 and no
# flag is present, no
radix character appears. If a radix character appears, at least one digit appears before it.
The value is rounded to the appropriate number of digits. The
fwprintf() family of
functions may make available wide-character string representations for infinity and NaN.
e,E The double argument is converted in the style [-]d.ddde_dd, where there is one digit before
the radix character (which is non-zero if the argument is non-zero) and the number of digits
after it is equal to the precision; if the precision is missing, it is taken as 6; if the precision
is 0 and no
# flag is present, no radix character appears. The value is rounded to the
appropriate number of digits. The E conversion wide-character will produce a number with
E instead of e introducing the exponent. The exponent always contains at least two digits.
If the value is 0, the exponent is 0. The
fwprintf() family of functions may make avail-
able wide-character string representations for infinity and NaN.
g,G The double argument is converted in the style f or e (or in the style
E in the case of a G
conversion wide-character), with the precision specifying the number of significant digits.
If an explicit precision is 0, it is taken as 1. The style used depends on the value converted;
style
e (or E) will be used only if the exponent resulting from such a conversion is less than
-4 or greater than or equal to the precision. Trailing zeros are removed from the fractional
portion of the result; a radix character appears only if it is followed by a digit. The
fwprintf() family of functions may make available wide-character string representa-
tions for infinity and NaN.
c If no l (ell) qualifier is present, the int argument is converted to a wide-character as if by
calling the btowc() function and the resulting wide-character is written. Otherwise the
wint_t argument is converted to wchar_t, and written.
s If no l (ell) qualifier is present, the argument must be a pointer to a character array con-
taining a character sequence beginning in the initial shift state. Characters from the array
are converted as if by repeated calls to the mbrtowc() function, with the conversion state
described by an mbstate_t object initialized to zero before the first character is converted,
and written up to (but not including) the terminating null wide-character. If the precision
is specified, no more than that many wide-characters are written. If the precision is not
specified or is greater than the size of the array, the array must contain a null wide-
character. 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 written up to (but not including) a ter-
minating null wide-character. If no precision is specified or is greater than the size of the
array, the array must contain a null wide-character. If a precision is specified, no more
than that many wide-characters are written.
p The argument must be a pointer to void. The value of the pointer is converted to a
sequence of printable wide-characters, in an implementation-dependent manner.
n The argument must be a pointer to an integer into which is written the number of wide-
characters written to the output so far by this call to one of the fwprintf() functions.
No argument is converted.
C Same as lc.
S Same as ls.
% Output a % wide-character; no argument is converted. The entire conversion specification
must be %%.
APPLICATION USAGE
After fwprintf() or wprintf() is applied to a stream, the stream becomes wide-oriented (see orien-
tation(5)).
RETURN VALUE
Upon successful completion, these functions return the number of wide-characters transmitted excluding
the terminating null wide-character in the case of swprintf() or a negative value if an output error was
encountered.
HP-UX 11i Version 1: September 2005 3 Hewlett-Packard Company Section 3291