title: Why pointer generates an error "invalid indirect"?
body: <p><code>p</code> is a pointer which points to array <code>arr</code>, we can get array <code>arr</code> by using <code>*p</code>, but why can not get second element by using <code>*p[2]</code>?</p>
  
  <p>It will cause an error : </p>
  
  <blockquote>
    <p>invalid indirect of p[1] (type int)</p>
  </blockquote>
  
  <p>The following code:</p>
  
  <pre><code>arr := [4]int{1,2,3,4}
  var p *[4]int = &amp;arr
  fmt.Println(p)     // output &amp;[1 2 3 4]
  fmt.Println(*p)    // output [1 2 3 4]
  fmt.Println(p[1])  // output 2
  fmt.Println(*p[1]) //generate an error:invalid indirect of p[1] (type int)
  </code></pre>