title: Dynamic allocation of 2D array within function (using pointers to return adress of allocated object)
body: <p>I'd /ike to know, how to pass pointers to dynamically allocated arrays using function arguments. This function is supposed to allocate array 10x10 (checks skipped for simplicity sake). Is this possible? What am i doing wrong? Thanks in advance.</p>
  
  <pre><code>int array_allocate2DArray ( int **array, unsigned int size_x, unsigned int size_y)
  {
      array = malloc (size_x * sizeof(int *));
  
      for (int i = 0; i &lt; size_x; i++)
          array[i] = malloc(size_y * sizeof(int));
  
      return 0;
  }
  
  int main()
  {
      int **array;
      array_allocate2DArray (*&amp;array, 10, 10);
  }
  </code></pre>