Last active
June 25, 2020 11:23
-
-
Save Jay-flow/2b8a3bdb3074efc5611eca72e46a171d to your computer and use it in GitHub Desktop.
How the computer handles variables
This file contains hidden or 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
#include <stdio.h> | |
void addValue() { | |
// It doesn't reset every time I call. | |
static int a = 10; | |
a = a + 10; | |
printf("%d\n", a); | |
} | |
int main(void) { | |
addValue() | |
addValue() | |
addValue() | |
addValue() | |
// a = 50 | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment