std::ferror
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <cstdio>
|
||
int ferror( FILE *stream ); |
||
Controlla il flusso di dati per gli errori.
Original:
Checks the given stream for errors.
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.
Indice |
[modifica] Parametri
stream | - | il flusso di file da controllare
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. |
[modifica] Valore di ritorno
Valore diverso da zero se il flusso di file è si sono verificati errori, 0 altrimenti
Original:
Nonzero value if the file stream has errors occurred, 0 otherwise
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.
[modifica] Esempio
#include <cstdio> #include <cstdlib> int main() { FILE* fp = std::fopen("test.txt", "r"); if(!fp) { std::perror("File opening failed"); return EXIT_FAILURE; } int c; // note: int, not char, required to handle EOF while ((c = std::fgetc(fp)) != EOF) { // standard C I/O file reading loop std::putchar(c); } if (std::ferror(fp)) std::puts("I/O error when reading"); else if (std::feof(fp)) std::puts("End of file reached successfully"); }
[modifica] Vedi anche
cancella errori 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. (funzione) | |
controlli per la fine del file Original: checks for the end-of-file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) | |
visualizza una stringa di caratteri del corrispondente errore di corrente 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. (funzione) | |
C documentation for ferror
|