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