title: What is difference between int (*p)[3] and int *p[3]?
body: <p>I totally understand what is "<code>int *p[3]</code>" ( p is an array of 3 pointer meaning we can have 3 different rows of any number of ints by allocating the memory as our size of different rows). </p>
  
  <p>My confusion lies with " <code>int (*p)[3]</code> "  what does this signifies? Is it like "p" stores the address of 3 contiguous memory of int or something else? </p>
  
  <p>Please clarify and also how to use use in program to distinguish them.</p>
  
  <p>Thanks a lot in advance.  </p>
  
  <pre><code>@revised
  </code></pre>
  
  <p>Sorry for putting up duplicate question. I didn't search my doubt intensively. But my doubt still remains as novice programmer. I went through both the pages of Q/A <a href="https://stackoverflow.com/questions/859634/c-pointer-to-array-array-of-pointers-disambiguation">C pointer to array/array of pointers disambiguation</a></p>
  
  <p>and </p>
  
  <p><a href="https://stackoverflow.com/questions/3382951/int-p-4">int (*p) [4]?</a></p>
  
  <p>second link partly clears the doubt so eliminate my doubt please explain above question in reference to stack and heap:
   for example </p>
  
  <pre><code>int *p[3]; // (1)
  </code></pre>
  
  <p>take 12(3*4bytes) bytes of stack and for heap will depend on run-time. 
  Now for </p>
  
  <pre><code>int (*p1)[3]; //(2)
  </code></pre>
  
  <p>(2) using "new" would be one as </p>
  
  <pre><code>p1 = new int[7][3]; // (3)
  </code></pre>
  
  <p>given in one of the answer of link <a href="https://stackoverflow.com/questions/3382951/int-p-4">int (*p) [4]?</a> ; Now my question is since " int (*p1)[3]; //(2) " is a pointer to am array of 3 ints so how much memory will be taken by p1 at compile time as eq(3) can a also be replaced by </p>
  
  <p><code>p1 = new int[n][3]; // (3) where n is an integer</code></p>
  
  <p>so what then?</p>
  
  <p>Please explain.</p>