title: Segmentation Fault, large arrays
body: <pre><code>#include &lt;stdio.h&gt;
  #define N 1024
  int main(){
    int i, j;
    int a[N][N];
    int b[N][N];
    for (i=0;i&lt;N;i++){
      a[i][i]=i;
      b[i][i]=i;
    }
    for (i=0;i&lt;N;i++)
      for(j=0;j&lt;N;j++)
      {
           printf("%d", a[i][j]);
           printf("%d", b[i][j]);
      }
    return 0;
  }
  </code></pre>
  
  <p>This program is a reason of segmentation fault, but if I define N as 1023, program will work correctly. Why it happens?</p>