title: Unusual warning when deallocating memory of a 2D array in C
body: <p>I'm trying to free the memory I allocated for my 2D array.</p>
  
  <p>The code is working fine, but I always have warnings when compiling.</p>
  
  <p>I tried 2 different methods but each time, a new warning appears.</p>
  
  <pre><code>    int* array = fillArray(); //malloc (n*m*sizeof*array)
  
      ...
      DeallocateMemory(array, n*m); //Where n and m are length and height
  
      void DeallocateMemory(int* array, int length)
      {
            for (int i = 0; i &lt; length; i++){
                //free(array[i]);
                //free((void*)array[i]);
            }
      }
      free(array);
  </code></pre>
  
  <p>Ok so at first, I wrote <code>free(array[i])</code> but the warning said : </p>
  
  <p>*passing argument 1 of <code>free</code> makes pointer from integer without a cast
  note: expected <code>void*</code> but argument is of type <code>int*</code></p>
  
  <p>So I wrote <code>void*</code>, but now the warning is :</p>
  
  <p><em>cast to a pointer from integer of different size</em></p>
  
  <p>What should I do to get rid of both errors? Thanks!</p>