This code produces a segmentation fault during the array declaration. I'm confused as to why this happens. I intentionally selected 2000000000 as a value because it is below 2^31 and can fit into an integer variable.
int main()
{
int nums_size = 2000000000;
int nums[nums_size];
int i;
for(i = 0; i < nums_size; i++) {
nums[i] = i;
}
return 0;
}