In C, each function has an activation record which is allocated on a stack frame. Local variables are allocated in their own function's activation record. So, what is the case with global variables? Where are they allocated?
For example
#include <stdio.h>
int a;
void v()
{a= 2;
int b;
b++;
}
main()
{
int f;
printf("\n%d",a);
v();
}
-----Activation record----
-------------------
-------------------
activation record for main
-------------------
int f
-------------------
-------------------
activation record of v
--------------------
int a
--------------------
int b
--------------------
---------------
Where is variable x
stored according to the activation record logic?