title: Dynamic Array Allocation in C
body: <p>the code is working but there is an error. Return array 
  using return by reference this function-> void alloc(int **array, int size).What do you think of this error?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void memoryys(int **array, int size);
  int main()
  {
      int i;
      int in;
      int *a1;
  
      printf("please number of elements  ");
      scanf("%d",in);
      alloc(&amp;a1,in);
  
      for(i=0;i&lt;in;i++){
         scanf("d ",&amp;a1[i]);
      }
      free(a1);
  
      return 0;
  }
  
  void alloc(int **array, int size){
     int i;
     *array = (int *) malloc(size*sizeof(int));
     if (*array == NULL){
        printf("Error\n");
        exit(-1);
     }
  }
  </code></pre>