Created
April 16, 2018 14:33
-
-
Save liweinan/b08404cc884795e7563fc8b611f4dafa to your computer and use it in GitHub Desktop.
x在foo内部的修改,外面看不见的,因为foo里面的x是在foo的stack上的复制品。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void foo(int x) { | |
x = 2; | |
} | |
int main() { | |
int x = 1; | |
foo(x); | |
printf("x: %d\n", x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment