|
From: Sam <sch...@ho...> - 2001-03-17 17:55:39
|
I'm trying to read through a file using the following statement:
while(!feof(filePtr)
{
fread(&phone, sizeof(struct record), 1, filePtr);
printf("%d%s", int, name);
count++;
}
The problem is that it reads the last record twice and increments the =
count one more time than needed. Could someone explain why this happens =
and how to avoid it using the feof function? Thanks.
Sam
|