Espaces de noms
Variantes
Affichages
Actions

feof

De cppreference.com
< c‎ | io

 
 
Fichier d'entrée / sortie
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Déposer accès
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.
Entrée / sortie directe
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
Entrée non formatée / sortie
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.
Mise en forme d'entrée / sortie
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.
Fichier de positionnement
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
Erreur de manipulation
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
Les opérations sur les fichiers
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 );
Vérifie si la fin du flux de fichier donné a été atteint .
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.

Sommaire

[modifier] Paramètres

stream -
le flux de fichier à vérifier
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.

[modifier] Retourne la valeur

valeur différente de zéro si la fin du flux a été atteinte, sinon 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.

[modifier] Notes

Cette fonction signale que l'état courant tel que rapporté par la plus récente opération E / S, il n'examine pas la source de données associée. Par exemple, si la plus récente d'E / S a été un fgetc, qui a retourné le dernier octet d'un fichier, feof renvoie une valeur non nulle. Le fgetc suivante échoue et modifie l'état de flux de fin-de-fichier. C'est alors seulement feof retourne zéro .
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.
En utilisation normale, le traitement des flux d'entrée s'arrête sur une erreur; feof et ferrror sont ensuite utilisés pour distinguer entre les différentes conditions d'erreur .
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.

[modifier] Exemple

#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");
}


[modifier] Voir aussi

efface les erreurs
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.

(fonction) [edit]
affiche une chaîne de caractères correspondant de l'erreur de courant à 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.

(fonction) [edit]
chèques pour une erreur de fichier
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.

(fonction) [edit]