Getting a past-the-end pointer
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/988158/take-the-address-of-a-one-past-the-end-array-element-via-subscript-legal-by-the">Take the address of a one-past-the-end array element via subscript: legal by the C++ Standard or not?</a>  </p>
</blockquote>



<pre><code>const int n = ...;
T a[n];
T* begin = &amp;a[0]; //or just a
T* end = begin + n;
</code></pre>

<p>I know this is legal and fine. However I am wondering if the following is undefined behavior or is legal as well. Does the answer depend on type T?</p>

<pre><code>T* end = &amp;a[n];
</code></pre>

<p>P.S. This question is a curiosity question, so please refrain from mentioning that vector is a better alternative to arrays and the like :)</p>
