The vfscanf_s
function reads a formatted string from a buffered FILE stream, and writes to a list of arguments.
- Parameters
-
[in] | stream | pointer to a FILE stream to read from |
[in] | fmt | format-control string. |
[out] | ap | arguments to write to |
- Precondition
- Neither
stream
nor fmt
shall be a null pointer.
-
fmt
shall not contain the conversion specifier n
-
None of the arguments corresponding to
s
is a null pointer. (not yet)
-
No encoding error shall occur.
-
c
, s
, 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 1 when reading with a c
into a single character) and except that the following errors are detected at runtime and call the currently installed constraint handler function.
- Returns
- Number of receiving arguments successfully assigned, or
EOF
if read failure occurs before the first receiving argument was assigned or if there is a runtime constraint violation.
- Return values
-
> | 0 on success, the number of arguments assigned |
EOF | on error |
- See also
- vvfscanf_s(), fwscanf_s(), scanf_s()