问题补充:
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,因为调用函数f并无改变a的值,只是改变形参b的值,函数结束后b被销毁
如果觉得《struct ty { int data;;char c;}; main(){struct ty a》对你有帮助,请点赞、收藏,并留下你的观点哦!