In C or C++ local objects are usually allocated on the stack. You are allocating something large on the stack, more than the stack can handle, so you are getting a STACKOVERFLOW.
Don't allocate it local on stack, use some other place instead. This can be achived by making the object global. Global variables are fine, if you don't use the from any other compilation unit. To make sure, this doesn't happen by accident, add a static storage specifier.
This will allocate in the BSS segment, which is a part of the heap:
static int c[1000000];
int main()
{
cout << "done\n";
return 0;
}
This will allocate in the DATA segment, which is a part of the heap too:
int c[1000000] = {};
int main()
{
cout << "done\n";
return 0;
}
This will allocate somwhere unspecified in the heap:
int main()
{
int* c = new int[1000000];
cout << "done\n";
return 0;
}