单选题
若有以下程序
#include<stdio.h>
typedef struct stu{
char name[10],gender;
int score;
}STU;
void f(STU a,STU b)
{ b=a;
printf("%s,%c,%d,",b.name,b.gender,b.score);
{
main()
{ STU a={"Zhao","m",290},b={"Qian","f",350};
f(a,b);
printf("%s,%c,%d/n",b.name,b.gender,b.score};
}
则程序的输出结果是______。
-
-
-
-
【正确答案】
A
【答案解析】[解析] f函数将结构体a赋值给b,然后输出,注意这是值传递,不会改变main中结构体b值,所以答案选择A。