The easiest way to understand the initialization of character arrays is to assign each element in the array one by one.
char str[ 10]={ 'I ',' ',' a ',' m ','
,' h ',' a ',' p ',' p ',' y ' };
That is, 10 characters are assigned to str[0] to str[9] 10 elements respectively.
If the number of characters provided in braces is greater than the length of the array, it will be regarded as a syntax error; If it is less than the length of the array, only the first element and the remaining elements in these character arrays are automatically designated as empty characters (i.e.
'\0' )。