Created
April 7, 2017 18:47
-
-
Save itsmemattchung/3fab543b80976389059f9ec9d8aded15 to your computer and use it in GitHub Desktop.
What's going on in memory?
This file contains 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> | |
int main(){ | |
printf("a = %d\n", a()); | |
printf("a = %d\n", a()); | |
printf("a = %d\n", a()); | |
printf("b = %d\n", b()); | |
printf("b = %d\n", b()); | |
printf("b = %d\n", b()); | |
} | |
int a(){ | |
static int i = 0; | |
return ++i; | |
} | |
int b(){ | |
int i = 0; | |
return ++i; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment