Everything

scanf


Inputs data from the standard input file (stdin) and converts it according to a format.

[Format]

#include <stdio.h>

long scanf (const char *control[, ptr...]);

[Parameters]

control Pointer to string indicating format

ptr,... Pointer to storage area that stores input and converted data

[Return values]

Normal: Number of data items successfully input and converted

Abnormal: EOF

[Remarks]

The scanf function inputs data from the standard input file (stdin), converts and edits it according to the string that represents the format pointed to by control, and stores the result in the storage area pointed to by ptr.

The scanf function returns the number of data items successfully input and converted as the return value. EOF is returned if the standard input file ends before the first conversion.

For details of the format specifications, see the description of the fscanf function.

For %e conversion, specify l for double type, and specify L for long double type. The default type is float.