See the below explanation about Arrays from Arduino's official site:
Creating (Declaring) an Array
All of the methods below are valid ways to create (declare) an array.
int myInts[6]; int myPins[] = {2, 4, 8, 3, 6}; int mySensVals[6] = {2, 4, -8, 3, 2}; char message[6] = "hello";You can declare an array without initializing it as in myInts.
In myPins we declare an array without explicitly choosing a size. The compiler counts the elements and creates an array of the appropriate size.
Finally you can both initialize and size your array, as in mySensVals. Note that when declaring an array of type char, one more element than your initialization is required, to hold the required null character.
I have the following problems to understand:
Isn't
int mySensVals[6] = {2, 4, -8, 3, 2};wrong? I count 5 elements.Isn't
char message[6] = "hello";is wrong as well? I count 5 elements.