Last active
June 25, 2020 10:42
-
-
Save Jay-flow/de676586305d1a0a36a56a5dddfe3912 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> | |
// 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