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

scanf(3) Guardian Native C Library Calls Reference Manual
c Accepts a single character or a series of characters. If there is either no
width or a width of 1 in the conversion specication, 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 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 specication, 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.
d Accepts a decimal integer; the corresponding pointer parameter should
be an integer pointer.
e, f, g Accepts a oating-point number. The next eld is converted accord-
ingly and stored through the corresponding parameter, which should be a
pointer to a oat. The input format for oating-point numbers is a string
of digits, with the following optional characteristics:
It can be a signed value.
It can be an exponential value, containing a decimal point fol-
lowed by an exponent eld, which consists of an E or e followed
by an optionally signed integer.
i Accepts a decimal integer unless:
The rst digit is a 0 (zero), in which case the integer is inter-
preted as an octal number.
The rst 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.
o Accepts an octal integer; the corresponding pointer parameter should be
an integer pointer.
p Matches an unsigned hexadecimal integer, the same as the %p conver-
sion of the printf() function. The corresponding pointer parameter must
be a pointer to a pointer to void.
66 Hewlett-Packard Company 527192-005