#include
int main(void)
{
struct student {
int num;
char name[19];
double score;
};
int i,k,N;
scanf("%d",&N);
for(i=0;i
{
struct student s[3];
struct student *p;
for(k=0;k
scanf("%d%s%lf",&s[k].num,&s[k].name,&s[k].score);
p = &s[k];
}
for(k=0;k
printf("%d\t%-20s%lf\n",s[k].num,s[k].name,s[k].score);
}
for(k=0;k
printf("%d\t%-20s%lf\n",p->num,p->name,p->score);
}
}
return 0;
}
编译器显示:Your Code: In function 'main':
Your Code:17:19: warning: format '%s' expects argument of type 'char ', but argument 3 has type 'char ()[19]' [-Wformat=]
scanf("%d%s%lf",&s[k].num,&s[k].name,&s[k].score);
^
0:编译失败,请检查源代码!
请问如何解决这个问题?谢谢各位好心人!急急急!!!