I am new to C language and found a problem below when I learned about array.
#include <stdio.h>
int main (void){
int array [10];
array [5] = 15;
printf("%d\n", array[5]);
printf("%d\n", array[9]);
return 0;
}
In this main method, first printf method returns 15 as I initialized the value of the array.
And I expect other non-initialized value such as array[9] returns 0 but this second printf method returns random numbers such as 32764 in my WSL2 Ubuntu system.
In a tutorial video I am watching, it returns 0. What is the difference and how does this happen?