单选题 有以下程序
#include <stdio.h>
#include<string.h>
struct A
{ int a;char b[10];double c;};
struct A f(struct A t);
main()
{ struct A a= {1001,"ZhangDa",1098.0};
a=f(a);printf("%d,%s,%6.1f/n",a.a,a.b,a.c);
}
struct A f(struct A t)
{ t.a=1002;
strcpy(t.b,"WangPeng");t.c=1220.0;return t;}
程序运行后的输出结果是______。
【正确答案】 D
【答案解析】[解析] 在主函数中定义结构体A的变量a,并对其赋初值,再调用函数f(a),在函数f(a)中对结构体变量a的各个成员重新进行了赋值操作,并把其值返回在屏幕上输出。