std::vscanf,std::vfscanf,std::vsscanf (3) - Linux Man Pages
std::vscanf,std::vfscanf,std::vsscanf - std::vscanf,std::vfscanf,std::vsscanf
Defined in header <cstdio>
int vscanf( const char* format, va_list vlist ); (1) (since C++11)
int vfscanf( std::FILE* stream, const char* format, va_list vlist ); (2) (since C++11)
int vsscanf( const char* buffer, const char* format, va_list vlist ); (3) (since C++11)
Reads data from the a variety of sources, interprets it according to format and stores the results into locations defined by vlist.
1) Reads the data from stdin.
2) Reads the data from file stream stream.
3) Reads the data from null-terminated character string buffer.
stream - input file stream to read from
buffer - pointer to a null-terminated character string to read from
pointer to a null-terminated character string specifying how to read the input.
The format string consists of
* non-whitespace multibyte characters except %: each such character in the format string consumes exactly one identical character from the input stream, or causes the function to fail if the next character on the stream does not compare equal.
* whitespace characters: any single whitespace character in the format string consumes all available consecutive whitespace characters from the input (determined as if by calling isspace in a loop). Note that there is no difference between "\n", " ", "\t\t", or other whitespace in the format string.
* conversion specifications. Each conversion specification has the following format:
* introductory % character
* (optional) assignment-suppressing character *. If this option is present, the function does not assign the result of the conversion to any receiving argument.
* (optional) integer number (greater than zero) that specifies maximum field width, that is, the maximum number of characters that the function is allowed to consume when doing the conversion specified by the current conversion specification. Note that %s and %[ may lead to buffer overflow if the width is not provided.
* (optional) length modifier that specifies the size of the receiving argument, that is, the actual destination type. This affects the conversion accuracy and overflow rules. The default destination type is different for each conversion type (see table below).
* conversion format specifier
The following format specifiers are available:
Conversion Explanation Argument type
length modifier hh h (none) l ll j z t L