为什么fscanf(fp,"%d",&i);无法执行
1个回答
2011-08-14
展开全部
确认文件打开成功,例如:
FILE *fp;
int i;
if((fp=fopen("test.txt","rt"))==NULL)
{
printf("cannot open file\n");
return;
}
fscanf(fp,"%d",&i);
FILE *fp;
int i;
if((fp=fopen("test.txt","rt"))==NULL)
{
printf("cannot open file\n");
return;
}
fscanf(fp,"%d",&i);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询