title: Crashing when array is moderate sized (1000x1000 int) - change stack size?
body: <p>I am trying to use a simple program to draw a Mandelbrot Set - the program produces an array of integers which correspond to colors in an image. I am working in Code::Blocks on Windows with gcc/MiniGW. It works great for small array sizes (~500x500). However, when I try and run after setting to 1000x1000, it crashes ("has stopped responding"). The same code compiles and executes successfully for any array size under a linux remote terminal using gcc (CentOS) with no special calling instructions. </p>
  
  <p>I think what I need to do is increase the stack size under Code::Blocks. To this end I have tried "-Wl,--stack,1024" under linker options in Code::Blocks. However I can no longer build -"unrecognized command line option '--stack,1024". Is there something wrong with this call?</p>
  
  <p>I'll put the code here but since it works on Linux as expected I don't think it is the issue. </p>
  
  <pre><code>int cal_pixel(double complex d,double b, int Nmax){
  int count = 1;
  double complex z = 0;
  while (cabs(z) &lt; b &amp;&amp; count &lt; Nmax){
      z=cpow(z,2)+d;
      count=count+1;
  }
  return count;
  }
  int main(int argc, char **argv) {
  unsigned int color[M][N];
  int i;
  int j;
  double complex d;
  double dx;
  double dy;
  double b = 2;
  char delim;
  delim = ',';
  dx = 2*b/(M-1);
  dy = 2*b/(N-1);
  FILE *fp;
  d=-3+0.1*I;
  for (j = 0;j &lt; N; j++){
      for (i = 0; i &lt; M; i++){
              d=(i*dx-b)+(j*dy-b)*I;
              color[i][j]=cal_pixel(d,2,250);
          }
  }
  fp = fopen("color.csv","w+");
  for (j = 0; j &lt; N; j++) {
      for (i = 0; i &lt; M; i++){
          fprintf(fp, "%d", color[i][j]);
          fprintf(fp, "%c",delim);
      }
      fprintf(fp, "\n");
  }
  fclose(fp);
  return 0;
  }
  </code></pre>