有以下程序:
#include <stdio.h>
struct STU{char Name[9]; char sex; int score[2]; };
void f(struct STU a[])
{ struct STU b={"Zhao",´m´,85,90};
a[1]=b;
}
main( )
{struct STU c[2]={{"Qian",´f´,95,92},{"Sun",´m´,98,99}};
f(C);
printf("%s,%c,%d,%d,",c[0].name, c[o].sex, c[o].score[0], c[0].score[1]);
printf("%s,%c,%d,%d\n",c[1].name,c[1].sex,c[1].score[0],c[1].score[1]);
}
程序运行后的输出结果是
本题考查把数组名作为函数参数。 执行 f 函数后, 结构体数组 c 的第二个元素被改写, c[1].name 为 Zhao, 因此选项 B 正确。