#includestruct student{int num;char name[10];int score;};void f(struct student st){st.score++;}void main(){ struct student st={200,"chenchen",76};f(st);printf("%d",st.score);}为什么最后输出的是76?不是加了1,不应该是77吗?

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/20 18:27:24
#includestruct student{int num;char name[10];int score;};void f(struct student st){st.score++;}void main(){ struct student st={200,
x)SK)MI-.)*M.Q(.J3JJs3sS bAEֵe) ifuqXu-XUnbffZj#<V17i]P,MCI5EIfunxٜ^}Y-f77xڵɮ6C )//I?0&Hc0douwRHĆX1$(LXDaٌR  &ETZb3-tƧK= I{Ce';V=ٱ+.L/!tɬ&l '{f=( T'?7F 1Rθ

#includestruct student{int num;char name[10];int score;};void f(struct student st){st.score++;}void main(){ struct student st={200,"chenchen",76};f(st);printf("%d",st.score);}为什么最后输出的是76?不是加了1,不应该是77吗?
#include
struct student{int num;char name[10];int score;};
void f(struct student st){st.score++;}
void main()
{ struct student st={200,"chenchen",76};
f(st);
printf("%d",st.score);
}
为什么最后输出的是76?不是加了1,不应该是77吗?

#includestruct student{int num;char name[10];int score;};void f(struct student st){st.score++;}void main(){ struct student st={200,"chenchen",76};f(st);printf("%d",st.score);}为什么最后输出的是76?不是加了1,不应该是77吗?
#include
struct student{int num;char name[10];int score;};
struct student st={200,"chenchen",76};
void f(void){st.score++;}
void main()
{
f();
printf("%d",st.score);
}
这样就好了
你的那个,f中的st是参变量加多少都不会改变最后的结果