Skip to content

Instantly share code, notes, and snippets.

@Jay-flow
Created June 25, 2020 12:11
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 Jay-flow/1c0044dc3cc07536f02c0af63a53993b to your computer and use it in GitHub Desktop.
Save Jay-flow/1c0044dc3cc07536f02c0af63a53993b to your computer and use it in GitHub Desktop.
How the computer handles variables
#include <stdio.h>
void add(int *a) {
*a = (*a) + 10;
}
int main(void) {
int a = 7;
add(&a);
// print: a = 17
printf("%d\n", a);
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment