问题
单项选择题
有以下程序:
#include <stdio.h>
struct STU
char name[10];
int num;
;
void f1(struct STU c)
struct STU b="LiSiGuo",2042;
c=b;
void f2(struct STU *c)
struct STU b="SanDan",2044;
*c=b;
main()
struct STU a="YangSan",2041, b="WangYin",2043;
f1(
A.; f2(&
B.;
printf("%d%d\n
答案
参考答案:A
解析: f2函数传递的是变量的地址,可以实现数据的交换,而f1函数传递的是值,调用完 f1函数后,c的值改变了,但main函数中的a值并未改变。