#include <stdio.h>
#define N 2
struct Student
{
char name[4];
float score;
};
main()
{
struct Student stu[N];
int i = 0;
for (; i < N; i++)
{
printf("input scores of student%d:\n", i + 1);
printf("name:");
scanf("%s", stu[i].name);
printf("score:");
scanf("%f", &stu[i].score);
}
}
请问最后一行 scanf要用"&" 符号是因为它时数组的第二个元素吗?
第一个不用是因为数组名即首元素地址