title: Malloc compile error: a value of type "int" cannot be used to initialize an entity of type int (*)[30]
body: <p>I must have tried 20 ways of doing this by now. I really need help, no matter what I do i get a error similar to this one.</p>
  
  <pre><code>a value of type "int" cannot be used to initialize an entity of type "int (*)[30]"
  </code></pre>
  
  <p>i.e. this will get me such an error</p>
  
  <pre><code>int(*array)[160] = malloc((sizeof *array) * 10);
  </code></pre>
  
  <p>and doing something like this</p>
  
  <pre><code>int** Make2DintArray(int arraySizeX, int arraySizeY) {
      int** theArray;
      theArray = (int**) malloc(arraySizeX*sizeof(int*));
      int i;
      for (i = 0; i &lt; arraySizeX; i++)
      {
          theArray[i] = (int*) malloc(arraySizeY*sizeof(int));
      }
      return theArray;
  }
  </code></pre>
  
  <p>will get me this</p>
  
  <pre><code>"void *(size_t)" in "memory.c" at line 239 and: "int()" 
  </code></pre>
  
  <p>does anyone have a solution for how to successful allocate a 2dArray of int[160][10]</p>