Skip to content

Instantly share code, notes, and snippets.

@liweinan
Created April 16, 2018 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liweinan/b08404cc884795e7563fc8b611f4dafa to your computer and use it in GitHub Desktop.
Save liweinan/b08404cc884795e7563fc8b611f4dafa to your computer and use it in GitHub Desktop.
x在foo内部的修改,外面看不见的,因为foo里面的x是在foo的stack上的复制品。
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