int days[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
Altho this looks like an assignment, assignment statements with arrays are not
allowed, and this syntax is legal only in a declaration.
If the size is omitted, the compiler uses the number of values. For example,
// is the same as the statement below:
int days[] = {31,28,31,30,31,30,31,31,30,31,30,31};
If an array has no initialization, the values are undefined.
float pressure[10]; // Initial values of pressure undefined.
If an explicit array size is specified, but an shorter initiliazation list is specified, the unspecified elements are set to zero.
float pressure[10] = {2.101, 2.32, 1.44};
This not only initializes the first three values, but all remaining elements are set to 0.0. To initialize an array to all zeros, initialize only the first value.
float p1[1000]; // No intitialization. float p2[1000] = {0.0}; // All 1000 values initialized to zero.
Character arrays can be initialized on the right by writing a double-quoted string.
char greeting[100] = "Hello"; // Remaining characters zero. char goodbye[] = "Adios"; // Array size is 6 (final zero on strings).