Espaços nominais
Variantes
Acções

std::vscanf, std::vfscanf, std::vsscanf

Da cppreference.com
< cpp‎ | io‎ | c

 
 
De entrada / saída da biblioteca
I / O manipuladores
C estilo de I / O
Buffers
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(obsoleta)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstrações
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
File I / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cordas I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Matriz de I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(obsoleta)
(obsoleta)
(obsoleta)
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Interface de categoria de erro
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
 
C estilo de I / O
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Arquivo de acesso
Original:
File access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Directa de entrada / saída
Original:
Direct input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Não formatado entrada / saída
Original:
Unformatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Formatado de entrada / saída
Original:
Formatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vscanfvfscanfvsscanf
(C++11)(C++11)(C++11)
Arquivo de posicionamento
Original:
File positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
De tratamento de erros
Original:
Error handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operações em arquivos
Original:
Operations on files
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido no cabeçalho <cstdio>
int vscanf(constchar*format, va_list vlist );
(1) (desde C++11)
int vfscanf( FILE *stream, constchar*format, va_list vlist );
(2) (desde C++11)
int vsscanf(constchar*buffer, constchar*format, va_list vlist );
(3) (desde C++11)
Lê os dados do uma variedade de fontes, interpreta-o de acordo com format e armazena os resultados em locais definidos pela vlist.
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.
1)
Lê os dados a partir de 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.
2)
Lê os dados do fluxo de arquivo stream.
Original:
Reads the data from file stream stream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Lê os dados terminada em nulo buffer cadeia de caracteres.
Original:
Reads the data from null-terminated character string buffer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar]Parâmetros

stream -
fluxo de arquivo de entrada para ler
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 -
ponteiro para uma cadeia de caracteres terminada em nulo para ler
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 -
ponteiro para uma cadeia de caracteres NULL-Terminated especificando como ler a entrada.
A cadeia de formato consiste de caracteres em branco (qualquer caractere único espaço em branco na string de formato consome todos os disponíveis caracteres consecutivos de espaço em branco da entrada), não-branco personagens, exceto % (cada personagem como nas seqüências de formato consome exatamente um personagem idêntico a partir da entrada) e especificações de conversão. Cada especificação de conversão tem o seguinte formato:
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.
  • % caráter introdutório
    Original:
    introductory % character
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) atribuição de supressão * personagem. Se esta opção estiver presente, a função não atribuir o resultado da conversão de um argumento de recepção.
    Original:
    (opcional) assignment-suppressing character *. If this option is present, the function does not assign the result of the conversion to any receiving argument.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) número inteiro (maior do que zero), que especifica' largura máxima de campo, isto é, o número máximo de caracteres que a função é permitido consumir ao fazer a conversão especificado pela especificação de conversão de corrente. Note-se que [% s% e pode levar a um estouro de buffer, se a largura não é fornecido.
    Original:
    (opcional) 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.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional)' modificador de comprimento que especifica o tamanho do argumento de recepção, isto é, o tipo de destino actual. Isso afeta a precisão de conversão e regras de estouro. O tipo de destino padrão é diferente para cada tipo de conversão (ver tabela abaixo).
    Original:
    (opcional)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).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • formato de conversão especificador
    Original:
    conversion format specifier
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Os especificadores de formato disponíveis são:
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.
Conversion
specifier
Explanation Argument type
length modifier hhh (none) llljztL
% matches literal %N/AN/AN/AN/AN/AN/AN/AN/AN/A
c matches a single characterN/AN/A
char*
wchar_t*
N/AN/AN/AN/AN/A
s matches a character string (a sequence of non-whitespace characters)
[set]
corresponde a uma seqüência não-vazia de personagem de set de caracteres.
Original:
matches a non-empty sequence of character from set of characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Se o primeiro caractere do conjunto é ^, então todos os personagens não no conjunto são correspondidos. Se o conjunto começa com ]^] ou então o carácter ] também está incluído no conjunto de.
Original:
If the first character of the set is ^, then all characters not in the set are matched. If the set begins with ] or ^] then the ] character is also included into the set.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
d
combina inteiro decimal' a.
Original:
matches a decimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 10 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 10 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
signedchar* or unsignedchar*
signedshort* or unsignedshort*
signedint* or unsignedint*
signedlong* or unsignedlong*
signedlonglong* or unsignedlonglong*
intmax_t* or uintmax_t*
size_t*
ptrdiff_t*
N/A
i
combina inteiro decimal' a.
Original:
matches a decimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 0 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 0 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
u
combina inteiro decimal sem sinal' a.
Original:
matches a unsigned decimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtoul() com o 0 valor para o argumento base
Original:
The format of the number is the same as expected by strtoul() with the value 0 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
o
corresponde a uma 'inteiro octal'.
Original:
matches an octal integer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 8 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 8 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
x
combina inteiro hexadecimal' um.
Original:
matches an hexadecimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 16 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 16 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n
retorna 'número de caracteres lidos até agora' o.
Original:
returns the number of characters read so far.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Nenhuma entrada é consumida. Não incrementa a contagem de atribuição. Se o especificador tem a atribuição de supressão operador definido, o comportamento é indefinido
Original:
No input is consumed. Does not increment the assignment count. If the specifier has assignment-suppressing operator defined, the behavior is undefined
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
a, A
e, E
f, F
g, G
combina 'número de ponto flutuante' um.
Original:
matches a floating-point number.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtof()
Original:
The format of the number is the same as expected by strtof()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
N/AN/A
float*
double*
N/AN/AN/AN/A
longdouble*
p
corresponde implementação seqüência de caracteres definidos definir um 'ponteiro'.
Original:
matches implementation defined character sequence defining a pointer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
printf família de funções deve produzir a mesma seqüência usando %p especificador de formato
Original:
printf family of functions should produce the same sequence using %p format specifier
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
N/AN/A
void**
N/AN/AN/AN/AN/AN/A
Original:
pointer to a null-terminated character string specifying how to read the input.
A cadeia de formato consiste de caracteres em branco (qualquer caractere único espaço em branco na string de formato consome todos os disponíveis caracteres consecutivos de espaço em branco da entrada), não-branco personagens, exceto % (cada personagem como nas seqüências de formato consome exatamente um personagem idêntico a partir da entrada) e especificações de conversão. Cada especificação de conversão tem o seguinte formato:
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.
  • % caráter introdutório
    Original:
    introductory % character
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) atribuição de supressão * personagem. Se esta opção estiver presente, a função não atribuir o resultado da conversão de um argumento de recepção.
    Original:
    (opcional) assignment-suppressing character *. If this option is present, the function does not assign the result of the conversion to any receiving argument.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional) número inteiro (maior do que zero), que especifica' largura máxima de campo, isto é, o número máximo de caracteres que a função é permitido consumir ao fazer a conversão especificado pela especificação de conversão de corrente. Note-se que [% s% e pode levar a um estouro de buffer, se a largura não é fornecido.
    Original:
    (opcional) 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.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (opcional)' modificador de comprimento que especifica o tamanho do argumento de recepção, isto é, o tipo de destino actual. Isso afeta a precisão de conversão e regras de estouro. O tipo de destino padrão é diferente para cada tipo de conversão (ver tabela abaixo).
    Original:
    (opcional)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).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • formato de conversão especificador
    Original:
    conversion format specifier
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Os especificadores de formato disponíveis são:
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.
Conversion
specifier
Explanation Argument type
length modifier hhh (none) llljztL
% matches literal %N/AN/AN/AN/AN/AN/AN/AN/AN/A
c matches a single characterN/AN/A
char*
wchar_t*
N/AN/AN/AN/AN/A
s matches a character string (a sequence of non-whitespace characters)
[set]
corresponde a uma seqüência não-vazia de personagem de set de caracteres.
Original:
matches a non-empty sequence of character from set of characters.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Se o primeiro caractere do conjunto é ^, então todos os personagens não no conjunto são correspondidos. Se o conjunto começa com ]^] ou então o carácter ] também está incluído no conjunto de.
Original:
If the first character of the set is ^, then all characters not in the set are matched. If the set begins with ] or ^] then the ] character is also included into the set.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
d
combina inteiro decimal' a.
Original:
matches a decimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 10 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 10 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
signedchar* or unsignedchar*
signedshort* or unsignedshort*
signedint* or unsignedint*
signedlong* or unsignedlong*
signedlonglong* or unsignedlonglong*
intmax_t* or uintmax_t*
size_t*
ptrdiff_t*
N/A
i
combina inteiro decimal' a.
Original:
matches a decimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 0 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 0 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
u
combina inteiro decimal sem sinal' a.
Original:
matches a unsigned decimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtoul() com o 0 valor para o argumento base
Original:
The format of the number is the same as expected by strtoul() with the value 0 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
o
corresponde a uma 'inteiro octal'.
Original:
matches an octal integer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 8 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 8 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
x
combina inteiro hexadecimal' um.
Original:
matches an hexadecimal integer'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtol() com o 16 valor para o argumento base
Original:
The format of the number is the same as expected by strtol() with the value 16 for the base argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n
retorna 'número de caracteres lidos até agora' o.
Original:
returns the number of characters read so far.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Nenhuma entrada é consumida. Não incrementa a contagem de atribuição. Se o especificador tem a atribuição de supressão operador definido, o comportamento é indefinido
Original:
No input is consumed. Does not increment the assignment count. If the specifier has assignment-suppressing operator defined, the behavior is undefined
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
a, A
e, E
f, F
g, G
combina 'número de ponto flutuante' um.
Original:
matches a floating-point number.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O formato do número é o mesmo que o esperado por strtof()
Original:
The format of the number is the same as expected by strtof()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
N/AN/A
float*
double*
N/AN/AN/AN/A
longdouble*
p
corresponde implementação seqüência de caracteres definidos definir um 'ponteiro'.
Original:
matches implementation defined character sequence defining a pointer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
printf família de funções deve produzir a mesma seqüência usando %p especificador de formato
Original:
printf family of functions should produce the same sequence using %p format specifier
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
N/AN/A
void**
N/AN/AN/AN/AN/AN/A
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
vlist -
lista de argumentos variável que contém os argumentos que recebem
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.

[editar]Valor de retorno

Número de argumentos ler com êxito, ou se a falha ocorre 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.

[editar]Exemplo

[editar]Veja também

lê entrada formatada de stdin, um fluxo de arquivo ou um tampão
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.

(função)[edit]
impressões saída formatada para stdout, um fluxo de arquivo ou um buffer
usando lista de argumentos variável
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.

(função)[edit]
Documentação C para vscanf, vfscanf, vsscanf
close