Why doesn't this segfault?
#include <stdio.h>
int main()
{
int i;
int arr[] = {1, 2, 3, 4};
for(i=0;i<8;i++)
{
arr[i] = i;
printf(" %d", arr[i]);
}
printf("
");
return 0;
}
But it does when I replace 8 with 9 in the for loop.
Note: I am trying it on 32 bit crunchbang linux
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…