这是什么原因啊,怎么修改呢
#include<stdio.h>
#include<string.h>
typedef struct{
int no;
char name[10];
float score;
}student;
int main()
{
student s[3]={{1001,"张三",95},{1002,"蔡四",96},{1003,"罗五",97}};
int i;
FILE *fp;
if(fp=fopen("student.txt","w+"))==NULL)
{
printf("文件打开失败");
return 0;
}
for(i=0;i<3;i++)
fprintf(fp,"%d %s %.2f\n",s[i].no,s[i].name,s[i].score);
fclose(fp);
return 0;
}
if(fp=fopen("student.txt","w+"))==NULL) 少了 '(' ,修改如下:if((fp=fopen("student.txt","w+"))==NULL)