C语言读取文件里的小数的问题
FILE*fileout;chartest_char[123];doubleprice;fileout=fopen("weather","r");if(fileout==...
FILE *fileout;
char test_char[123];
double price;
fileout = fopen("weather","r");
if(fileout == NULL)
{
printf("open file false\n");
return 0;
}
fprintf(stderr,"file out = %s\n",test_char);
while(fscanf(fileout,"%f"&price)!=EOF);
printf("%5.5f\n",price);
fclose(fileout);
return 0
程序老报错。。不知道那里有问题呢,while(fscanf(fileout,"%f"&price)!=EOF);这一句读取数字是按书上说的写的啊 展开
char test_char[123];
double price;
fileout = fopen("weather","r");
if(fileout == NULL)
{
printf("open file false\n");
return 0;
}
fprintf(stderr,"file out = %s\n",test_char);
while(fscanf(fileout,"%f"&price)!=EOF);
printf("%5.5f\n",price);
fclose(fileout);
return 0
程序老报错。。不知道那里有问题呢,while(fscanf(fileout,"%f"&price)!=EOF);这一句读取数字是按书上说的写的啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询