How to declare a 3-Dimensional Array with very big size in C? : <p>I'm trying to create a 3 Dimensional array <strong>S[ ][ ][ ]</strong>...</p>

<p>when the size is small for example:</p>

<pre><code>  m=40;  
  int S[m][m][m];
  memset(S, 0, sizeof(S[1][1][1])*m * m * m);  //initialize all the array with 0//
  for (i=1 ; i&lt;=m ; i++ )  { 
      k=1;
     for (j=1 ; j&lt;=n ; j++ ) {
       if(statement) {   //if statment true i put in S array a value//
       S[i][i][k]=j;    k++;}
</code></pre>

<p>it works fine(for small size like S[ 40 ][ 40 ][ 40 ]... When the size is big, for example:</p>

<pre><code>  m=1500;
  int S[m][m][m];
  memset(S, 0, sizeof(S[1][1][1])*m * m * m);
  ....
  ....
</code></pre>

<p>My program stop working probably for memory usage or something like, that i don't know for sure...Any idea?</p>

<p>Thanks.</p>
