Performs formatted input from the standard input (stdin), interpreting it according to the format specification. Format #include <stdio.h> int scanf (const char *format_spec, . . . );
1 – Arguments
format_spec Pointer to a string containing the format specification. The format specification consists of characters to be taken literally from the input or converted and placed in memory at the specified input sources. . . . Optional expressions that are pointers to objects whose resultant types correspond to conversion specifications given in the format specification. If no conversion specifications are given, you can omit these input pointers. Otherwise, the function call must have at least as many input pointers as there are conversion specifications, and the conversion specifications must match the types of the input pointers. Conversion specifications are matched to input sources in left- to-right order. Excess input pointers, if any, are ignored.
2 – Return Values
x The number of successfully matched and assigned input items. EOF Indicates that a read error occurred prior to any successful conversions. The function sets errno. For a list of errno values set by this function, see fscanf.