title: How to use "pointer to array 10 of int"?
body: <p>I have the following code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int(* a)[10];  //declare a as pointer to array 10 of int
      int b[10];    // taken a array of 10 int
      b[2]=32;       
      a=&amp;b;      
      printf("b is on %p\n",&amp;b);
      printf("a is on %p\n",a);
      printf("magic is %d\n",a[2]); // why this is not showing 32
      return 0;
  }
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>b is on 0xbfa966d4
  a is on 0xbfa966d4
  magic is -1079417052
  </code></pre>
  
  <p>Here I have taken <code>a</code> as <strong>pointer to array 10 of int</strong> which points to the array <code>b</code>, so now why am I unable to get the value of 32 on <code>a[2]</code>?</p>
  
  <p><code>a[2]</code>  is evaluated as <code>*(a+2)</code> so now a has address of array <code>b</code> so <code>*(b+2)</code> and <code>*(a+2)</code> are similar so why am I not getting value 32 here?</p>
  
  <hr>
  
  <p><strong>Edit :</strong>
  i got answer by using </p>
  
  <pre><code>(*a)[2]
  </code></pre>
  
  <p>but i am not getting how it works ...
  see 
  when </p>
  
  <p><code>a[2]</code> is <code>*(a+2)</code> and <code>a+2</code> is a plus <code>2 * sizeof(int[10])</code> bytes.</p>
  
  <p>this way     <code>(*a)[2]</code> how expand?</p>