Namensräume
Varianten

std::feof

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

 
 
Input / Output-Bibliothek
I / O-Manipulatoren
C-style I / O
Puffern
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(veraltet)
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.
Abstraktionen
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Datei-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.
basic_ifstream
basic_ofstream
basic_fstream
String 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.
basic_istringstream
basic_ostringstream
basic_stringstream
Array 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.
istrstream(veraltet)
ostrstream(veraltet)
strstream(veraltet)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Fehler Kategorie Schnittstelle
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.
iostream_category(C++11)
io_errc(C++11)
 
C-style I / O
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Dateizugriff
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.
Direkte Eingabe / Ausgabe
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
Unformatierte Eingang / Ausgang
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.
Formatierte Eingabe / Ausgabe
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.
Datei Positionierung
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
Fehlerbehandlung
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
Operationen auf Dateien
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
 
definiert in Header <cstdio>
int feof( FILE* stream );
Prüft, ob das Ende der angegebenen Datei-Stream erreicht wurde .
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.

Inhaltsverzeichnis

[Bearbeiten]Parameter

stream -
der Datei-Stream zu überprüfen
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.

[Bearbeiten]Rückgabewert

Null-Wert, wenn das Ende des Stroms erreicht ist, andernfalls 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.

[Bearbeiten]Notes

Diese Funktion meldet nur den Strom Staat als von der jüngsten I / O-Operation berichtet, ist es nicht untersuchen die zugeordneten Datenquellen. Zum Beispiel, wenn die neueste I / O war ein std::fgetc, das das letzte Byte einer Datei zurückgeführt, kehrt std::feof ungleich Null. Der nächste std::fgetc ausfällt und ändert den Strom Staat end-of-file. Erst dann std::feof Null zurück .
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 std::fgetc, which returned the last byte of a file, std::feof returns non-zero. The next std::fgetc fails and changes the stream state to end-of-file. Only then std::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.
In der typischen Anwendung, stoppt Input Stream Processing bei jedem Fehler; feof und std::ferrror werden dann verwendet, um zwischen verschiedenen Fehlerbedingungen unterscheiden .
Original:
In typical usage, input stream processing stops on any error; feof and std::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.

[Bearbeiten]Beispiel

[edit]
#include <cstdio>#include <cstdlib>   int main(){ FILE* fp =std::fopen("test.txt", "r");if(!fp){std::perror("File opening failed");returnEXIT_FAILURE;}   int c;// note: int, not char, required to handle EOFwhile((c =std::fgetc(fp))!=EOF){// standard C I/O file reading loopstd::putchar(c);}   if(std::ferror(fp))std::puts("I/O error when reading");elseif(std::feof(fp))std::puts("End of file reached successfully");}


[Bearbeiten]Siehe auch

prüft, ob am Ende der Datei erreicht wurde
Original:
checks if end-of-file 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.

(öffentliche Elementfunktion of std::basic_ios)[edit]
löscht Fehler
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.

(Funktion)[edit]
zeigt eine Zeichenfolge entspricht der aktuellen Fehler 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.

(Funktion)[edit]
Prüfungen für eine Datei Fehler
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.

(Funktion)[edit]
close