Is data allocated on stack inside a function cleared when the function ends? The following code gives me an error (program terminates with 0xC00000FD exception code):
void fun()
{
const long len = (1024 * 1024) / 4; // 1 MB
int aa[len]{};
}
int main()
{
fun();
const long len = (1024 * 1024) / 4; // 1 MB
int aa[len]{};
}
If I do not call fun() at the beginning it works fine.
Also, what is a default stack size using MinGW?