std::vscanf, std::vfscanf, std::vsscanf
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <cstdio> 中定义
|
||
int vscanf( const char *format, va_list vlist ); |
(1) | (C++11 起) |
int vfscanf( FILE *stream, const char *format, va_list vlist ); |
(2) | (C++11 起) |
int vsscanf( const char *buffer, const char *format, va_list vlist ); |
(3) | (C++11 起) |
从各种来源中读取数据,解释它根据
format
vlist
所定义的位置,并将结果存储到.原文:
Reads data from the a variety of sources, interprets it according to
format
and stores the results into locations defined by vlist
.1)
读取的数据stdin.
2)
读取文件中的数据流
stream
.原文:
Reads the data from file stream
stream
.3)
读取的数据null结尾的字符串
buffer
.原文:
Reads the data from null-terminated character string
buffer
.目录 |
[编辑] 参数
stream | - | 输入文件流中读取
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
buffer | - | 指针指向一个空结束的字符串读取
原文: pointer to a null-terminated character string to read from | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
format | - | 指针指向一个空结束的字符串指定如何读取输入。
格式字符串由空白字符(格式字符串中的任何空白字符消耗所有可用的连续空格字符的输入),非空白字符除了
% (每个这样的格式字符串的字符占用一个相同的字符的输入)转换规范。每个转换规格的格式如下:原文: The format string consists of whitespace characters (any single whitespace character in the format string consumes all available consecutive whitespace characters from the input), non-whitespace characters except % (each such character in the format strings consumes exactly one identical character from the input) and conversion specifications. Each conversion specification has the following format:
下面的格式说明符
原文: The following format specifiers are available:
原文: pointer to a null-terminated character string specifying how to read the input.
格式字符串由空白字符(格式字符串中的任何空白字符消耗所有可用的连续空格字符的输入),非空白字符除了
% (每个这样的格式字符串的字符占用一个相同的字符的输入)转换规范。每个转换规格的格式如下:原文: The format string consists of whitespace characters (any single whitespace character in the format string consumes all available consecutive whitespace characters from the input), non-whitespace characters except % (each such character in the format strings consumes exactly one identical character from the input) and conversion specifications. Each conversion specification has the following format:
下面的格式说明符
原文: The following format specifiers are available:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
vlist | - | 可变参数列表,其中包含接收的参数
原文: variable argument list containing the receiving arguments |
[编辑] 返回值
成功读取的参数个数,或EOF如果发生故障.
原文:
Number of arguments successfully read, or EOF if failure occurs.
[编辑] 示例
本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
stdin,文件流或缓冲区的读取格式的输入 原文: reads formatted input from stdin, a file stream or a buffer (函数) | |
打印格式化的输出stdout,一个文件流或buffer 使用可变参数列表 原文: prints formatted output to stdout, a file stream or a buffer using variable argument list (函数) | |
C documentation for vscanf, vfscanf, vsscanf
|