title: Accessing 2d array with pointers in c++, how to assign address to pointer?
body: <p>I am having a question in mind about c pointers to 2d array. We often write:</p>
  
  <pre><code>int (*p)[3]=a //here a is a 2d array 
  </code></pre>
  
  <p>but writing as:</p>
  
  <pre><code>int (*p)[3]=a[0]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>int (*p)[3]=&amp;a[0]
  </code></pre>
  
  <p>produces the same result that is the base address of <code>a</code>. And if we <code>cout p</code>, it produces same result as <code>*p</code>.</p>
  
  <p>Why this all is happening.</p>