I don\'t know exactly why a file pointer reads an extra line from a file, specifically the last line, here is the code:
FILE *fp ; fp = fopen (\"mac_ip.txt\"
Your code resembles to the following example
#include int main(void) { char buffer[256]; FILE * myfile; myfile = fopen("some.txt","r"); while (!feof(myfile)) { fgets(buffer,256,myfile); printf("%s",buffer); } fclose(myfile); return 0; }
from
http://www.friedspace.com/feof.html