I've been using C for a while and this code surprised me.
int main(void) {
int array[] = {100};
int i;
for (i = 0; i<100; i++){
printf("%d \n",array[i]);
}
return 0;
}
When I execute this program, it doesn't crash. In the for loop, where is the number 100 put any value that you want. Beyond the array[0] position, the program outputs random numbers. I hope that someone could help me with that.