int xx(word w[])
{
FILE *fp;
int i;
if((fp = fopen("C:\\input.txt","rb+"))==NULL)//以读写方式打开
{
printf("没有找到文件!\n");
exit(0);
}
for (i=0;!feof(fp);i++)
{
fscanf(fp," %c",&w[i].ID);
}
fclose (fp);
return i-1;
}
从文本读入数据到W[I]结构体中,然后逐个词法分析,遇到空格停止,可是读入数据中不能读入空格!!!求大神解救,fgets函数不懂用,给个例子也行