//测试可用
#include
int main()
{
FILE *fout;
if((fout=fopen("abc.txt","r"))==NULL)
{
printf("Cannot open this file!\n");
return 0;
}
int temp;
while(!feof(fout))
{
if(fscanf(fout,"%d",&temp)!=1)
break;
printf("%d ",temp);
}
return 0;
}
/*把这个c语言文件和abc.txt放在同一文件夹,然后编译运行,
如果指定路径请给出路径;望采纳*/