このプログラムがクラッシュするのはなぜですか? 最大 1e6 で問題なく動作し、すべての値を 0 に設定しなければ問題なく動作します。
プログラムは割り当てられたすべてのメモリを取得しませんか?
int main() {
const int max = 10000000; // 1e7
int end[max];
unsigned int i;
for ( i = 0; i < max; i++ )
end[i] = 0;
}
$ gcc test.c && ./a.out
Segmentation fault (core dumped)