c/io/fscanf

Reads data from a variety of sources, interprets it according to and stores the results into given locations.

@1@ reads the data from stdin @2@ reads the data from file stream @3@ reads the data from null-terminated character string. Reaching the end of the string is equivalent to reaching the end-of-file condition for @4-6@ Same as, except that , , and conversion specifiers each expect two arguments (the usual pointer and a value of type rsize_t indicating the size of the receiving array, which may be  when reading with a  into a single char) and except that the following errors are detected at runtime and call the currently installed constraint handler function:
 * any of the arguments of pointer type is a null pointer
 * ,, or is a null pointer
 * the number of characters that would be written by, , or , plus the terminating null character, would exceed the second argument provided for each of those conversion specifiers
 * optionally, any other detectable error, such as unknown conversion specifier

Parameters
If a conversion specification is invalid, the behavior is undefined.

Return value
@1-3@ Number of receiving arguments successfully assigned (which may be zero in case a matching failure occurred before the first receiving argument was assigned), or eof if input failure occurs before the first receiving argument was assigned. @4-6@ Same as, except that eof is also returned if there is a runtime constraint violation.

Complexity
Not guaranteed. Notably, some implementations of are $O(N)$, where.