I hope this helps:
Code:
int main()
{
  const int c = 2;
  int* p = new int[c];
  for ( int i = 0; i <= c; i++ ) // trouble: <= instead of <
    p[i] = i;
  delete[] p; // crash: origin: <=
  return 0;
}