Skip to content

Instantly share code, notes, and snippets.

@Jay-flow
Last active June 25, 2020 10:42
Show Gist options
  • Save Jay-flow/de676586305d1a0a36a56a5dddfe3912 to your computer and use it in GitHub Desktop.
Save Jay-flow/de676586305d1a0a36a56a5dddfe3912 to your computer and use it in GitHub Desktop.
How the computer handles variables
#include <stdio.h>
// this is a global variable.
int a = 1;
// Can be used within a function without declaration.
void changeValue() {
a = 5
}
int main(void) {
printf("%d\n", a);
changeValue();
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