Posted on 2008-06-18 20:25
形式系统 阅读(163)
评论(0) 编辑 收藏 引用 网摘 所属分类:
编程开发
文件读的示例代码:
#include <stdio.h>
FILE *f;
void main() {
double d1,d2=0;
if((f=fopen("D:\\a.txt","r"))==NULL) {
printf("Error");
exit(1);
}
while(!feof(f)) {
fscanf(f,"%lf%lf",&d1,&d2);
}
printf("%lf,%lf\n",d1,d2);
fclose(f);
}