运行环境:windows7,Dev-C++4.9.9.2#include<stdio.h>#include<stdlib.h>int main(){FILE *fp;int a,b;if((fp=fopen("E:\\task.txt","r"))==NULL){printf("不能打开文件!\n");while(1);exit(0);}文件task.txt的内容:1,302,203,404,20int j;while(!feof(fp)){ j=feof(fp);printf("j=%d\n",j);fscanf(fp,"%d,%d",&a,&b);printf("%d,%d\n",a,b);}fclose(fp);while(1);return 0;}
- 1 回答
- 0 关注
- 59 浏览
添加回答
举报
0/150
提交
取消