HP C/iX Library Reference Manual (30026-90004)

322 Chapter5
HP C/iX Library Function Descriptions
sprintmsg
sprintmsg
Prints formatted output with numbered arguments to a character array.
Syntax
int sprintmsg (char *
s
, char *
format [, arg]
...)
Parameters
s
A pointer to a character array where the output is directed
format
A pointer to the string containing the formatting information. It contains
optional placeholders and formatting specifications where
arg1
thru
argn
are to be substituted.
arg1 ... argn
A character, character pointer, or integer value giving the parameter to
be converted, formatted, and merged with
format
prior to output.
Return Values
x The number of characters transmitted.
EOF Indicates failure.
Description
This function is derived from printf(). In sprintmsg(), the conversion character % is
replaced by the sequence %n$. The n character is a decimal digit in the range 1-9, and
indicates that this conversion should be applied to the nth argument, rather than to the
next unused one. All other aspects of formatting are unchanged. All conversion
specifications must contain the %n$ sequence, and you should make sure the numbering is
correct. All parameters must be used exactly once. See printf() for more details on
formatting and conversion specifications.
See Also
fprintmsg(), printf(), printmsg()