Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (s) scanf(3)
—Az followed by a d, i, o, u, x, X,orn conversion code character indicates that
the receiving variable is treated as a size_t or the corresponding unsigned integer
type.
• A conversion code character convcode that specifies the type of conversion to be
applied:
% Accepts a single % (percent sign) input at this point; no assignment is
done.
c Accepts a single character or a series of characters. If there is either no
width or a width of 1 in the conversion specification, one character is
accepted and the corresponding pointer parameter should be a type char
pointer. If there is a width greater than 1, the indicated number of char-
acters are accepted and the corresponding pointer parameter should be
an array of type char.
The normal skip over white space is suppressed. Use %1s rather than
%1c to read the next non-white-space character.
C or lc Accepts a single character or a series of characters and converts to
wchar_t type. If there is either no width or a width of 1 in the conver-
sion specification, one character is accepted and the corresponding
pointer parameter should be a type wchar_t pointer. If there is a width
greater than 1, the indicated number of characters are accepted and the
corresponding pointer parameter should be an array of type wchar_t.
The normal skip over white space is suppressed. Use %1S rather than
%1C to read the next non-white-space character.
For TNS/E systems only, the behavior of lc is the same as the behavior
of C.
d Accepts a decimal integer; the corresponding pointer parameter should
be an integer pointer.
a, A, e, E, f, F
, g, G
Accepts
a floating-point number. The next field is converted accord-
ingly and stored through the corresponding parameter, which should be a
pointer to a float. The input format must be the same as expected for the
subject sequence of the strtod() function. For more information, see the
strtod(3) reference page.
i Accepts a decimal integer unless:
— The first digit is a 0 (zero), in which case the integer is inter-
preted as an octal number.
— The first two characters are 0x or 0X, in which case the integer is
interpreted as a hexadecimal number.
The corresponding pointer parameter should be an integer pointer.
n Consumes no input. The corresponding pointer parameter is a pointer to
an integer into which is written the number of characters read from the
input stream so far by this function. The assignment count returned at
the completion of this function is not incremented.
527192-018 Hewlett-Packard Company 6−21