#include<stdio.h>
void bar()
{
int a=4;
}
void foo()
{
int a;
printf("%d",a);
}
int main()
{
bar();
foo();
}
I'm sure that the above program gives the output as some junk value(Thats what happenes when i compile and run). But I read in an article that it is possible for some compilers to give the output as 4 itself. The explanation given was that it is related to activation stack and activation frames. I dont understand. Is it something like the value of int a=4 from bar() function is stored somewhere in the activation stack for future use??I'm confused!!