std::wscanf,std::fwscanf,std::swscanf (3) - Linux Man Pages
std::wscanf,std::fwscanf,std::swscanf - std::wscanf,std::fwscanf,std::swscanf
Defined in header <cwchar>
int wscanf( const wchar_t* format, ... ); (1)
int fwscanf( std::FILE* stream, const wchar_t* format, ... ); (2)
int swscanf( const wchar_t* buffer, const wchar_t* format, ... ); (3)
Reads data from the a variety of sources, interprets it according to format and stores the results into given locations.
1) Reads the data from stdin.
2) Reads the data from file stream stream.
3) Reads the data from null-terminated wide string buffer.
stream - input file stream to read from
buffer - pointer to a null-terminated wide string to read from
pointer to a null-terminated wide string specifying how to read the input.
The format string consists of
* non-whitespace wide 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 iswspace 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