title: increment of pointer to array
body: <p>I'm trying to understand why the following C++ code does not compile</p>
  
  <pre class="lang-cpp prettyprint-override"><code>int main () {
    int a[10];
    int (*p)[10] = &amp;a;
    int *q = static_cast&lt;int *&gt;(++p);
  }
  </code></pre>
  
  <p>If it's not obvious, what I was trying to do is find a pointer to the end of the array by using pointer arithmetic.</p>
  
  <p>My understanding so far is that <code>p</code> has type pointer to array of ten ints and so does the expression <code>++p</code>.  Normally, I can assign an array of ints to a variable of type pointer to int but this fails on the incremented pointer <code>++p</code>.</p>
  
  <p>I first tried without the <code>static_cast</code> but that didn't work either.</p>