Okay, so I was teaching my girlfriend some c++, and she wrote a program that I thought wouldn\'t work, but it did. It accesses one more element in the array then there is (f
C/C++ does not do boundary checking when using arrays.
Since you are declaring a stack based array. Accessing outside the bounds of the array will just access another part of already allocated stack space.
So basically when you access something that is out of bounds, it won't throw a segmentation fault unless its completely out of your stack memory.
C/C++ is dangerous with array boundaries remember that!