Scanf

scanf, short for scan formatted, is a C standard library function that reads and parses text from standard input.

The function accepts a format string parameter that specifies the layout of input text. The function parses input text and loads values into variables based on data type.

Similar functions, with other names, predate C, such as readf in ALGOL 68.

Input format strings are complementary to output format strings (see printf), which provide formatted output (templating).