C++ - Why is out-of-bounds pointer arithmetic undefined behaviour?
<p>The following example is from Wikipedia. <a href="http://en.wikipedia.org/wiki/Undefined_behavior">http://en.wikipedia.org/wiki/Undefined_behavior</a></p>

<pre><code>int arr[4] = {0, 1, 2, 3};
int* p = arr + 5;  // undefined behavior
</code></pre>

<p>If I never dereference p, then why is arr + 5 alone undefined behaviour? I expect pointers to behave as integers - with the exception that when dereferenced the value of a pointer is considered as a memory address.</p>
