The output of the application (below) is as follows:
Item index number: 0 Item content: 22
Item index number: 1 Item content: 22
Item index number: 2 Item content: 22
Item index number: 3 Item content: 22
Item index number: 4 Item content: 22
Item content: 22 Item index number: 22 Item Content: 134513712
Why are index entries labeled 5-21 missing? I understand that this code can do segfault to the limit of an overflowed array, it is designed for this, I am not interested in why this code is bad, just why some indexes are skipped.
#include <stdio.h>
int main(){
int array[5];
int i;
for(i=0; i<10; ++i){
array[i] = 22;
printf("Element index number: %d Element contents: %d\n", i, array[i]);
}
return 0;
}
learning2code