Last active
August 29, 2015 14:05
-
-
Save LuminousMonkey/eb47b9b1f283d1d8838b to your computer and use it in GitHub Desktop.
Contrived Activation Record Experiment
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 outerFunction() { | |
int z = 88; | |
printf("outerFunction z: %d\n", z); | |
} | |
int main() { | |
int x = 11; | |
int y = 55; | |
int z = y; | |
printf("main x: %d\n", x); | |
{ | |
int x = 22; | |
printf("main inner block x: %d\n", x); | |
printf("main inner block y: %d\n", y); | |
x += z; | |
printf("main inner block x after z added: %d\n", x); | |
} | |
outerFunction(); | |
void innerFunction() { | |
printf("Inner function z: %d\n", z); | |
} | |
innerFunction(); | |
printf("main x: %d\n", x); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment