*Conan The Librarian
Reads input from a character string in memory, interpreting it
according to the format specification.
int sscanf (const char *str, const char *format_spec, . . . );
The address of the character string that provides the input text
A pointer to a character string that contains the format
. . .
Optional expressions whose resultant types correspond to
conversion specifications given in the format specification.
If no conversion specifications are given, you can omit the input
pointers. Otherwise, the function calls must have at least as
many input pointers as there are conversion specifications, and
the conversion specifications must match the types of the input
Conversion specifications are matched to input sources in left-
to-right order. Excess input pointers, if any, are ignored.
The following is an example of a conversion specification:
char str = "4 17";
sscanf(str, "%d %d", &temp, &temp2);
printf("The answers are %d and %d.", temp, temp2);
This example produces the following output:
$ RUN EXAMPLE
The answers are 4 and 17.
x The number of successfully matched and
assigned input items.
EOF Indicates that a read error occurred before
any conversion. The function sets errno. For a
list of the values set by this function, see