HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)
p
printf(3S) printf(3S)
For American usage, format would point to the string:
"%1$s, %2$s %3$d, %4$*6$.*7$d:%5$*6$.*7$d"
and result in the output:
"Sunday, July 3, 10:02"
For German usage, the string:
"%1$s, %3$s %2$d, %4$*6$.*7$d:%5$*6$.*7$d"
results in the output:
Sonntag, 3 Juli 10:02
WARNINGS
Notice that with the c conversion character, an int arg is converted to an unsigned char. Hence, whole
multibyte characters cannot be printed using a single
c conversion character.
A precision with the
s conversion character might result in the truncation of a multibyte character.
Use of a conversion character which doesn’t match the type of the corresponding argument passed in will
result in invalid data being returned. For example, the modifying ll, specifying that the following
d, i, o,
u, x,orX conversion character applies to a long long integer arg, is necessary for proper results when the
argument is a long long integer.
AUTHOR
printf(), fprintf() , and sprintf() were developed by AT&T and HP.
SEE ALSO
ecvt(3C), ltostr(3C), setlocale(3C), putc(3S), scanf(3S), stdio(3S), orientation(5), thread_safety(5).
STANDARDS CONFORMANCE
printf(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
fprintf(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
sprintf(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C
Section 3−−666 Hewlett-Packard Company − 5 − HP-UX 11i Version 1: September 2005