English
Language : 

CC78K0S Datasheet, PDF (200/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
sscanf (normal model only)
I/O Functions
sscanf executes the format commands in “format” in sequence and if any format command fails, the function will
terminate.
(a) A white-space character in the control string causes sscanf to read any number (including zero) of white-
space characters up to the first non-white-space character (which will not be read). This white-space
character command fails if it does not encounter any non-white-space characters.
(b) A non-white-space character causes sscanf to read and discard a matching character. This command
fails if the specified character is not found.
(c) The format commands define a collection of input streams for each type specifier (to be described later).
The format commands are executed according to the following steps.
• The input white-space characters (specified by isspace) are skipped over, except when the type
specifier is [, c, or n.
• The input data items are read from the string “s”, except when the type specifier is n. The input data items are
defined as the longest input stream of the first partial stream of the string indicated by the type specifier (but
up to the maximum field width if so specified). The character next to the input data items is interpreted as not
having been read. If the length of the input data items is 0, the format command execution fails.
• The input data items (number of input characters with the type specifier n) are converted to the type specified
by the type specifier except the type specifier %. If the input data items do not match the specified type, the
command execution fails. Unless assignment is suppressed by *, the result of the conversion is stored in the
object pointed to by the first argument which follows “format” and has not yet received the result of the
conversion.
The following type specifiers are available:
d ........................... Converts a decimal integer (which may be signed). The corresponding argument must
be a pointer to an integer.
i ............................ Converts an integer (which may be signed). If a number is preceded by 0x or 0X, the
number is interpreted as a hexadecimal integer. If a number is preceded by 0, the
number is interpreted as an octal integer. Other numbers are regarded as decimal
integers. The corresponding argument must be a pointer to an integer.
o ........................... Converts an octal integer (which may be signed). The corresponding argument must be
a pointer to an integer.
u ........................... Converts an unsigned decimal integer.
The corresponding argument must be a pointer to an unsigned integer.
x ........................... Converts a hexadecimal integer (which may be signed).
e, E, f, g, G........... Floating point value consists of optional sign (+ or –), one or more consecutive decimal
number(s) including decimal point, optional exponent (e or E), and the following optional
signed integer value. When overflow occurs as a result of conversion, or when
underflow occurs with the conversion result ±∞, a non-normalized number or ±0
becomes the conversion result. The corresponding argument is a pointer to float.
200
User’s Manual U14872EJ1V0UM