English
Language : 

CC78K4 Datasheet, PDF (187/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 10 LIBRARY FUNCTIONS
4-4 scanf
I/O Functions
FUNCTION
scanf reads data from SFR according to the format.
HEADER
stdio.h
FUNCTION PROTOTYPE
int scanf (const char *format, ...);
Function
scanf
Arguments
format ... Pointer to the
character string to indicate
input conversion specification
format
... ... Pointer (0 or more)
argument to the object to
assign the converted value
Return Value
When the character string s is
not null ... number of input
items assigned
EXPLANATION
• Performs input using the getchar function. Specifies the input string permitted by the character string
indicated by format. Uses the arguments after format as pointers to an object. format specifies how the
conversion is performed by the input string.
• When there are not enough arguments for format, normal operation is not guaranteed. When the number of
arguments is excessive, the expression will be evaluated but not input.
• format consists of 0 or more directives. The directives are as follows.
(1) One or more null character (character that makes isspace true)
(2) Normal character (other than %)
(3) Conversion indication
• If a conversion ends with an input character that conflicts with the directive, the conflicting input character is
rounded down. The conversion indication is the same as that of the sscanf function.
User’s Manual U15556EJ1V0UM
187