A-A+

有以下程序#inculde #inculde strt

2022-08-06 04:25:07 问答库 阅读 175 次

问题详情

有以下程序
#inculde <stdio.h>
#inculde <string.h>
strtict A
{ int a;char B[10];douBle c;};
void F (struct A t);
main()
{ struct A a ={1001,”zhangDa”,1098.0};
F(a);printF(“%d,%s,%6.1Fn”,a.,a.B,a.c);
void F(struct A t)
{ t.a=1002;strcpy(t.B,”ChangRong”);t.c=1202.0;}
程序运行后的输出结果是
A.1001,zhangDa,1098.0
B.1002,ChangRong,1202.0
C.1001,ChangRong,10980
D.1002,zhangDa,1202.0请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:A
解析:该函数的调用为传值调用,故不会改变任何值。

考点:程序