Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
fscanf(3) Guardian Native C Library Calls Reference Manual
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.
s Accepts a string of characters. The input field ends with a white-space
character. If width is given, the corresponding pointer parameter refers
to a character array and the indicated number of type char values are
read. A string of type char values is written to the array. The array must
be large enough to contain the output string with a terminating null byte
appended.
S Accepts a string of characters. The input field ends with a white-space
character. If width is given, the behavior of the conversion is undefined.
The corresponding pointer parameter should be a pointer to an array of
type wchar_t. A string of type wchar_t is written to the array. The
array must be large enough to contain the output string with a terminat-
ing null wide character appended.
u Accepts an unsigned decimal integer; the corresponding pointer parame-
ter should be an unsigned integer pointer.
x Accepts a hexadecimal integer; the corresponding pointer parameter
should be an integer pointer.
[scanset] Accepts as input the characters included in scanset. scanset explicitly
defines the characters that are accepted in the input stream to be those
enclosed within [](square brackets). The corresponding pointer param-
eter should be an array of type char. The leading white space that is
normally skipped over is suppressed. A scanset in the form [ˆscanset] is
an exclusive scanset: the ˆ (circumflex) is a complement operator and
the characters in the following scanset are not accepted as input. Con-
ventions used in the construction of scanset are:
— You can represent a range of characters by the construct first-
last. Thus, you can express [0123456789] as [0-9]. The first
value must be lexically less than or equal to the last value, or
else the - (dash) stands for itself. The - (dash) also stands for
itself whenever it is the first or last character in scanset.
— You can include the ] (right bracket) as an element of scanset if
it is the first character of scanset. In this case, it is not inter-
preted as the bracket that closes scanset.Ifscanset is an
exclusive scanset, the ] is preceded by the ˆ (circumflex) to make
the ] an element of scanset. The corresponding pointer parame-
ter must point to a character array large enough to contain the
output string with a terminating 0 (zero) appended. The 0 is
added automatically.
The results from the conversion are placed in *pointer unless you specify assignment suppres-
sion with an * (asterisk). Assignment suppression provides a way to describe an input field that
is to be skipped. The input field is a string of non-white-space characters. It extends to the next
inappropriate character or until width, if specified, is reached.
2−92 Hewlett-Packard Company 527192-007