S
Spiros Bousbouras
/* ... */
f = fopen("some-file" , "r") ;
if ( f == NULL ) {
/* Exits */
}
clearerr(f) ;
while ( ( a=getc(f) ) != EOF ) {
/* Do stuff */
}
if ( ferror(f) ) {
/* Exits */
}
Is the call to clearerr() necessary ? If ferror() returns 0
can one be reasonably certain that the whole file has been
read ?
f = fopen("some-file" , "r") ;
if ( f == NULL ) {
/* Exits */
}
clearerr(f) ;
while ( ( a=getc(f) ) != EOF ) {
/* Do stuff */
}
if ( ferror(f) ) {
/* Exits */
}
Is the call to clearerr() necessary ? If ferror() returns 0
can one be reasonably certain that the whole file has been
read ?