Zilog EZ80F916 User Manual

Page 379

Advertising
background image

UM014423-0607

C Standard Library

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

359

An optional decimal integer that specifies the maximum field width.

An optional h, l or L indicating the size of the receiving object. The conversion
characters d, l, n, o, and x can be preceded by h to indicate that the corresponding
argument is a pointer to short_int rather than a pointer to int, or by l to indicate that it
is a pointer to long_int. Similarly, the conversion character u can be preceded by h to
indicate that the corresponding argument is a pointer to unsigned_short_int rather than
a pointer to unsigned_int, or by l to indicate that it is a pointer to unsigned_long_int.
Finally, the conversion characters e, f, and g can be preceded by l to indicate that the
corresponding argument is a pointer to double rather than a pointer to float, or by L to
indicate a pointer to long_double. If an h, l, or L appears with any other conversion
character, it is ignored.

A character that specifies the type of conversion to be applied. The valid conversion
characters are described in the following paragraphs.

The

scanf

function executes each directive of the format in turn. If a directive fails, as

detailed below, the

scanf

function returns. Failures are described as input failures (due to

the unavailability of input characters), or matching failures (due to inappropriate input).

A directive composed of white space is executed by reading input up to the first non-
white-space character (which remains unread), or until no more characters can be read. A
white-space directive fails if no white-space character can be found.

A directive that is an ordinary character is executed by reading the next character of the
stream. If the character differs from the one comprising the directive, the directive fails,
and the character remains unread.

A directive that is a conversion specification defines a set of matching input sequences, as
described below for each character. A conversion specification is executed in the follow-
ing steps:

Input white-space characters (as specified by the

isspace

function) are skipped,

unless the specification includes a ’[’, ’c,’ or ’n’ character.

An input item is read from the stream, unless the specification includes an n character.
An input item is defined as the longest sequence of input characters (up to any
specified maximum field width) which is an initial subsequence of a matching
sequence. The first character, if any, after the input item remains unread. If the length
of the input item is zero, the execution of the directive fails: this condition is a
matching failure, unless an error prevented input from the stream, in which case it is
an input failure.

Except in the case of a % character, the input item (or, in the case of a

%n

directive, the

count of input characters) is converted to a type appropriate to the conversion
character. If the input item is not a matching sequence, the execution of the directive
fails: this condition is a matching failure. Unless assignment suppression was
indicated by a *, the result of the conversion is placed in the object pointed to by the
first argument following the format argument that has not already received a

Advertising
This manual is related to the following products: