the correct format for a loop that uses feof is -

Code:
 
// pseudo code
 
fread some data
while(!feof(file) and other conditions){
   process the data
 
   fread more data
   }
notice that the loop will terminate without executing the procesing if it does nto recieve the data.