A array is a pointer to a space in memory. When you dont declare an array first as a[3], this memoryspace is not reserved.
However, it can be used to store data in and get data from, just like you do above. You can imagine in bigger applications this causes problems, since the same memoryspace will be used twice.
Accessing beyond the end of array a stomps part of the program stack. Since arrays grow upwards in memory and stack typically grows downward, this stomps already allocated stack space.
Yeah the way you usually want to declare an array is to put down how many units in size the array will be (int x[a number here]), and then state the content of each unit on one line (int x[number] = {10, 9, ...}).