English
Language : 

CC78K0S Datasheet, PDF (204/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
4-4 scanf (normal model only)
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
... ... 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 argument after format as the pointer 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 input character, the conflicting input
character is rounded down. The conversion indication is the same as that of the sscanf function.
204
User’s Manual U14872EJ1V0UM