7.19.6.4 The scanf function

Synopsis

1

#include <stdio.h>
int scanf(const char * restrict format, ...);

Description

2

The scanf function is equivalent to fscanf with the argument stdin interposed before the arguments to scanf.

Returns

3

The scanf function returns the value of the macro EOF if an input failure occurs before any conversion. Otherwise, the scanf function returns the number of input items assigned, which can be fewer than provided for, or even zero, in the event of an early matching failure.