A-A+

阅读下列程序 则程序的输出结果为【 】。 includestdio.h struct t

2022-08-12 18:51:40 问答库 阅读 197 次

问题详情

阅读下列程序,则程序的输出结果为【 】。 include"stdio.h" struct ty { int data; char c;}; main() { struct ty a={30,x}; fun(a); printf("%d%c",a.data,a.c);} fun(struct ty b) { b.data=20; b.c=y;}


请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:30x
本题的参数传递属于值传递,所以函数内不能改变调用函数中的数据。

考点:程序,结果