Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

printf(3) OSS Library Calls Reference Manual
NAME
printf - Prints formatted output to the standard output stream
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdio.h>
int printf (
const char *format
[, value]...
);
PARAMETERS
format Specifies a character string combining literal characters with conversion
specifications.
value Specifies the data to be converted according to the format parameter.
DESCRIPTION
The printf( ) function converts, formats, and writes its value parameters, under control of the for-
mat parameter, to the standard output stream stdout.
The format parameter is a character string that contains two types of objects:
Literal characters, which are copied to the output stream.
Conversion specifications, each of which causes zero or more items to be fetched from
the value parameter list.
If there are not enough items for format in the value parameter list, the results are unpredictable.
If more values remain after the entire format has been processed, they are ignored.
Conversion Specifications
Each conversion specification in the format parameter has the following syntax:
A % (percent sign).
The printf( ) function can handle a format string that enables the system to process ele-
ments of the parameter list in variable order. In such a case, the normal conversion char-
acter % (percent sign) is replaced by %digit$, where digit is a decimal number in the
range from 1 to NL_ARGMAX. Conversion is then applied to the specified argument,
rather than to the next unused argument. This feature provides for the definition of for-
mat strings in an order appropriate to specific languages. When variable ordering is
used, the * (asterisk) specification for field width in precision is replaced by %digit$.If
the variable ordering feature is used, it must be specified for all conversions.
Zero or more flags that modify the meaning of the conversion specification. The flag
characters and their meanings are as follows:
Format the integer portion of the result of a decimal conversion (%i, %d,
%u, %f, %F, %g, or %G) with thousands’ grouping characters, using the
nonmonetary grouping character. For other conversions the behavior is
undefined.
566 Hewlett-Packard Company 527187-017