Q:

How global declaration of largly sized array works in C?

#define N 10000000
int arr[N];

int main(void)
{
   int i;
   for(i=0;i<N;i++)
      arr[i]=i+1;
}

Why declaring the array globally do not give any compilation error? What is the chance of the availability of contiguous memory of N*4 bytes in the stack? 
Same for declaring the array with static keyword.

A:

This image should help. You can see that on the stack we are allocating memory only for local variables and arrays and function calls and pointers.
While the Global variables/ Static are stored on Perm Storage.

