I have been trying to find a good way to replace feof(); but havn't quite found one. I have been trying to read a file line by line until i hit the end of the file and then print if out onto the screen. This is what I have:The problem with this is that it gets the last string twice. How do I fix this?Code:while(fgets(temp,sizeof(temp),fp)!=NULL){ fgets(string,sizeof(string),fp); puts(string); }
~Sven