Generally there is nothing wrong to use feof(). You just have to know that EOF is set after scanning has failed, that means that you still have to check the return value of your fscanf() calls. If you do so then there is no more need to call feof()

Kurt