Espaços nominais
Variantes
Acções

feof

Da cppreference.com
< c‎ | io

 
 
File input/output
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.
fread
fwrite
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.
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.
ftell
fgetpos
fseek
fsetpos
rewind
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.
clearerr
feof
ferror
perror
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.
remove
rename
tmpfile
tmpnam
 
Defined in header <stdio.h>
int feof( FILE *stream );
Verifica se o fim do fluxo determinado arquivo foi atingido.
Original:
Checks if the end of the given file stream has been reached.
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 -
o fluxo de arquivo para verificar
Original:
the file stream to check
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

valor diferente de zero se o fim do fluxo foi atingido, de outro modo 0
Original:
nonzero value if the end of the stream has been reached, otherwise 0
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Notas

Esta função só informa o estado de fluxo, conforme relatado pelo mais recente operação I / O, que não examina a fonte de dados associado. Por exemplo, se o que eu mais recentes / O foi um fgetc, que retornou o último byte de um arquivo, feof retorna não-zero. O fgetc próxima falha e muda o estado de fluxo para' fim-de-arquivo. Só então feof retorna zero.
Original:
This function only reports the stream state as reported by the most recent I/O operation, it does not examine the associated data source. For example, if the most recent I/O was a fgetc, which returned the last byte of a file, feof returns non-zero. The next fgetc fails and changes the stream state to end-of-file. Only then feof returns zero.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Em utilização normal, o processamento pára no fluxo de entrada de qualquer erro, e feof ferrror são então utilizados para distinguir entre as condições de erro diferentes.
Original:
In typical usage, input stream processing stops on any error; feof and ferrror are then used to distinguish between different error conditions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

#include <stdio.h>
#include <stdlib.h>
 
int main()
{
    FILE* fp = fopen("test.txt", "r");
    if(!fp) {
        perror("File opening failed");
        return EXIT_FAILURE;
    }
 
    int c; // note: int, not char, required to handle EOF
    while ((c = fgetc(fp)) != EOF) { // typical file reading loop
       putchar(c);
    }
 
    if (ferror(fp))
        puts("I/O error when reading");
    else if (feof(fp))
        puts("End of file reached successfully");
}


[editar] Veja também

elimina erros
Original:
clears errors
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]
exibe uma seqüência de caracteres correspondente do erro atual para stderr
Original:
displays a character string corresponding of the current error to stderr
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]
verifica um erro de arquivo
Original:
checks for a file error
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]