feof()
Examines whether an end of file has been noted.
Synopsis
int feof( file f );
Parameters
Parameter | Meaning |
---|---|
f | File |
Return value
Value is not equal to 0 if end of file has been noted.
Error
Description
Returns a value not equal to 0 if an end of file has been noted for f .
Example
main()
{
file f;
string dummy;
f=fopen("C:/TEMP/TEST.TXT","r+");//read and write
while (feof(f)==0) // so long as it is not at the end
{
fgets(dummy,20,f); // reads from the file in dummy
DebugN(dummy);
}
rewind(f); // back to the beginning
fputs("Neue 1. Zeile",f); // writes to the beginning
fclose(f);
}
Assignment
CTRL