This code does not read the full text file.namely,first 30-40 does not read the word. why ?
word source : http://www.cs.hmc.edu/~geoff/classes/hmc.cs070.200009/homework10/simple.dict
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp = fopen("simple.txt","r");
char buf[25];
while (!feof(fp))
{
fscanf(fp,"%s",buf);
printf(" %s\n ", buf);
}
fclose(fp);
return 0;
}
a.out | more