有以下程序:
#include<stdio.h>
#include<string.h>
struet A
{ int a;ehar b[10];double c;};
struet A f(struet A t);
main()
{ struet A a={1001,"ZhangDa",1098.0};
a=f(a);printf("%d,%s,%6.If\n",a.a,a.b,a.c);
}
struet A f(struet A t)
{t.a=1002;strcpy(t.b,"ChangRong");t.c=1202.0;return t;}
程序运行后的输出结果是( )。
【正确答案】 D
【答案解析】函数f对结构体成员进行修改,并返回新的结构体;main函数先定义了一个结构体变量a并为它赋初值,然后调用函数f修改结构体变量的成员值,最后输出新的结构体变量成员。