vscanf, vfscanf, vsscanf
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <stdio.h>
|
||
| int vscanf( const char *format, va_list vlist ); |
(1) | (C99 起) |
| (2) | (C99 起) | |
| int vsscanf( const char *buffer, const char *format, va_list vlist ); |
(3) | (C99 起) |
從各種來源中讀取數據,解釋它根據
formatvlist所定義的位置,並將結果存儲到.Original:
Reads data from the a variety of sources, interprets it according to
format and stores the results into locations defined by vlist.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
1)
從stdin讀取數據
Original:
Reads the data from stdin
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
讀取文件中的數據流
streamOriginal:
Reads the data from file stream
streamThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
3)
null結尾的字元串
buffer讀取數據Original:
Reads the data from null-terminated character string
bufferThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目錄 |
[编辑] 參數
| stream | - | 輸入文件流中讀取
Original: input file stream to read from The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| buffer | - | 指針指向一個空結束的字元串讀取
Original: pointer to a null-terminated character string to read from The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| format | - | 指針指向一個空結束的字元串指定如何讀取輸入。
格式字元串由空白字元(格式字元串中的任何空白字元消耗所有可用的連續空格字元的輸入),非空白字元除了
%(每個這樣的格式字元串的字元佔用一個相同的字元的輸入)轉換規範。每個轉換規格的格式如下:Original: 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 text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.
下面的格式說明符
Original: The following format specifiers are available: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.
Original: pointer to a null-terminated character string specifying how to read the input.
格式字元串由空白字元(格式字元串中的任何空白字元消耗所有可用的連續空格字元的輸入),非空白字元除了
%(每個這樣的格式字元串的字元佔用一個相同的字元的輸入)轉換規範。每個轉換規格的格式如下:Original: 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 text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.
下面的格式說明符
Original: The following format specifiers are available: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.
The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vlist | - | 可變參數列表,其中包含接收的參數
Original: variable argument list containing the receiving arguments The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[编辑] 返回值
成功讀取的參數個數,或EOF如果發生故障.
Original:
Number of arguments successfully read, or EOF if failure occurs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 為例
| 本節是不完整的 原因: no example |
[编辑] 另請參閱
| stdin,文件流或緩衝區的讀取格式的輸入 Original: reads formatted input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函數) | |
| 列印格式化的輸出stdout,一個文件流或buffer 使用可變參數列表 Original: prints formatted output to stdout, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函數) | |
| C++ documentation for vscanf, vfscanf, vsscanf
| |