Yes, but there are cases where overwriting an array can actually be very useful. Resist the temptation to ask the compiler to check for a possible overwrite. While it might be possible to check some constructions at compile time, the example quoted can only be checked at run time. Its up to the programmer to do this, not the compiler !
↧