阅读下列程序,则程序的输出结果为______。 #include "stdio.h" struet ty { int data; char c;}; main( ) { street ty a={30,’x’};

admin2010-09-05  13

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

选项

答案30x

解析 本题的参数传递属于值传递,所以被调用函数内不能改变调用函数中的数据。
转载请注明原文地址:https://kaotiyun.com/show/WYWp777K
0

最新回复(0)