title: Replace malloc with array
body: <p>I have an image processing program (canny-edge-detection), here is one part of the code:</p>
  
  <pre><code>short int **magnitude;
  int rows=320, cols=240;
  
  //Allocate memory to store the image, warning if not successful
  if((*magnitude = (short *) calloc(rows*cols, sizeof(short))) == NULL){
    //some warning
  }
  </code></pre>
  
  <p>I would like to use an array to avoid allocating memory dynamically, since it is not feasible at the system I'm about to run the code on. What is the size of the array in this case? I assumed </p>
  
  <pre><code>short int magnitude_arr[76800]
  </code></pre>
  
  <p>However the output image got cut in half.</p>