Arrays in C are not checked at runtime. In other words, you can "define" an array of size N and happily access off of the end of the array bound. If you go off the end of the array, then you will trash memory somewhere on the stack (or the heap).
Once you trash memory somewhere, your program is likely to crash. These crashes can be hard to track down because they might crash far away from where you actually overran the end of the array.
Typically when you declare arrays in C, it's best to use some sort of constant or #define to mark the size of the array:
#define MAX_ELEMENTS 10
int array[MAX_ELEMENTS];
int cnt;
for(cnt = 0; cnt < MAX_ELEMENTS; cnt+=1) {
array[cnt] = cnt;
}
If you go past MAX_ELEMENTS in the array assignment, you might overwrite the value of cnt. You might overwrite some other variable. All depends on the compiler and the code structure. Also note the use of the < sign in the for loop. C arrays are 0 based so you have to check using less-than and not less-than-or-equal-to.