
------------------------------------------------------------------------------
6.13 Read formatted data from standard input. <Main>
------------------------------------------------------------------------------
[Name]
scanf
[Syntax]
#include <stdio.h>
int scanf( const char *format [, argument]... ) ;
[Arguments]
format Format control string.
argument Optional arguments.
[Return]
Returns a number of fields converted successfully. This may be less
than the requested number to "scanf". This does not includes fields
which has been read and not converted. Returns EOF if any error is
detected in a stream before the first conversion, or the end of file
is detected. Return value zero means that no fields have been
converted.
[Description]
Reads formatted data to arguments from the standard input stream
(stdin). "argument" are pointer to variables whose types are same as
type specification in "format". Format specification controls
decoding input fields. Specify one or more of following characters
for format specification.
* Whitespace -- space(' '), tab('¥t'), newline('¥n')
Skips whitespace characters in input data till the next
non-whitespace character.
* Non-whitespace character except a percent sign ('%')
Skips non-whitespece character which is same as specified
one. If the next character in the standard input (stdin) is
not same as specified one, process will be terminated.
* Format specification following to a percent sign ('%')
Reads input characters, and converts to specified type.
Converted value is stored in the variable pointed by the
argument.