Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C Library Calls (s) scanf(3)
Conversion Specifications
Each conversion specication in the format parameter has the following syntax:
%[digit$][*][width][sizecode]convcode
The character % (percent sign) or %digit$.
The scanf() function can handle a format string that enables the system to process an
element of the input stream for storage at a specic pointer location. In such a case, the
normal conversion specier % (percent sign) is replaced by %digit$, where digit is a
decimal number in the range 1 through NL_ARGMAX. Conversion is then applied to
the specied pointer, rather than to the next unused pointer.
This variable ordering feature provides for the denition of format strings in an order
appropriate to specic languages. If this feature is used, it must be specied for all
conversions in format except for conversion specications that do not have correspond-
ing pointers (that is, conversion specications with the * [asterisk] assignment suppres-
sion character and %% conversion specications).
If more than one conversion specication species the same value for digit, the results of
the function are undened.
The optional assignment suppression character * (asterisk).
An optional decimal digit string width that species the maximum eld width.
An optional sizecode indicating the size of the receiving variable for some values of
convcode. The sizecode can be h, l, ll,orL, as follows:
An h followed by a d, i, o, u,orx conversion code character indicates that the
receiving variable is treated as a short int or unsigned short int.
An l followed by a d, i, o, u,orx conversion code character indicates that the
receiving variable is treated as a long int or unsigned long int.
An l followed by an e, f,org conversion code character indicates that the receiv-
ing variable is treated as a double instead of a float.
An ll followed by a d, i, o, u,orx conversion code character indicates that the
receiving variable is treated as a long long int or unsigned long long int.
An ll followed by an e, f,org conversion code character indicates that the
receiving variable is treated as a double instead of a float.
An L followed by an e, f,org conversion code character indicates that the
receiving variable is treated as a long double.
An L followed by a d, i, n, o,orx conversion code character indicates that the
receiving variable is treated as a long long, which is a 64-bit integer data type.
A conversion code character convcode that species the type of conversion to be
applied:
% Accepts a single % (percent sign) input at this point; no assignment is
done.
527192-005 Hewlett-Packard Company 65