Why does my program crash when I increment a pointer and then delete it?
<p>I was solving some programming exercise when I realised that I have a big misunderstanding about pointers. Please could someone explain the reason that this code causes a crash in C++. </p>

<pre><code>#include &lt;iostream&gt;

int main()
{
    int* someInts = new int[5];

    someInts[0] = 1; 
    someInts[1] = 1;

    std::cout &lt;&lt; *someInts;
    someInts++; //This line causes program to crash 

    delete[] someInts;
    return 0;
}
</code></pre>

<p>P.S I am aware that there is no reason to use "new" here, I am just making the example as small as possible.</p>