I made a small test to see how the stack is used in a C application.
#include <stdio.h> void a(void) { int a = 0; } void b(void) { int b; printf("%i\n", b++); } int main(void) { a(); b(); b(); b(); fflush(stdin), getc(stdin); return 0; } Isn't b allocated in the same place on the stack where a was? I would expect the output to be 0 1 2, but instead I get the same garbage value three times. Why is that?
bwas probably enregistered.