I can declare an array of size 10^6 globally in c, but when I declared it inside the main() function it doesn't work.Why is it so? this statement causes runtime error:
int main()
{
long long arr[1000001];
return 1;
}
but this runs perfectly:
static long long arr[1000001];
int main()
{
return 1;
}