C/C++ does not check array lengths, so you can write past the array size. What then happens depends on what's in the memory past the array. Chance is that's another global array, or some variable that you then overwrite.