English
Language : 

CC78K0S Datasheet, PDF (201/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
sscanf (normal model only)
I/O Functions
s ...........................
[............................
c ...........................
p...........................
n...........................
%..........................
Input a character string consisting of a non-white-space character string. The
corresponding argument is a pointer to an integer. 0x or 0X can be allocated at the first
hexadecimal integer. The corresponding argument must be a pointer an array that has
sufficient size to accommodate this character string and a null terminator. The null
terminator will be automatically added.
Inputs a character string consisting of expected character groups (called a scanset).
The corresponding argument must be a pointer to the first character of an array that has
sufficient size to accommodate this character string and a null terminator. The null
terminator will be automatically added. The format commands continue from this
character up to the closing square bracket (]). The character string (called a scanlist)
enclosed in the square brackets constitutes a scanset except when the character
immediately after the opening square bracket is a circumflex (^).
When the character is a circumflex, all the characters other than a scanlist between the
circumflex and the closing square bracket constitute a scanset. However, when a
scanlist begins with [ ] or [^], this closing square bracket is contained in the scanlist
and the next closing square list becomes the end of the scanlist.
A hyphen (–) at other than the left or right end of a scanlist is interpreted as the
punctuation mark for hyphenation if the character at the left of the range specifying
hyphen (–) is not smaller than the right-hand character in ASCII code.
Inputs a character string consisting of the number of characters specified by the field
width. (If the field width specification is omitted, 1 is assumed.) The corresponding
argument must be a pointer to the first character of an array that has sufficient size to
accommodate this character string. The null terminator will not be added.
Reads an unsigned hexadecimal integer. The corresponding argument must be a
pointer to void.
Receives no input from the string s. The corresponding argument must be a pointer to
an integer. The number of characters that are read thus far by this function from the
string “s” is stored in the object that is pointed to by this pointer. The %n format
command is not included in the return value assignment count.
Reads a % sign. Neither conversion nor assignment takes place.
If a format specification is invalid, the format command execution fails.
If a null terminator appears in the input stream, sscanf will terminate.
If an overflow occurs in an integer conversion (with the d, i, o, u, x, or p format specifier), the higher bits will be
truncated depending on the number of bits of the data type after the conversion.
The syntax of input format commands is illustrated below.
User’s Manual U14872EJ1V0UM
201