Stack overflow There is a limit on a stack size (OS dependent) int foo() { double x[1048576]; x[0] = 10; return 0; } int main() { foo(); return 0; }