There is no essential difference between the initialization of character arrays and the initialization of numeric arrays. However, in addition to assigning characters to array elements one by one, it can also be initialized directly with strings. (1) Use character constants to initialize arrays one by one. For example, char a [8] = {'I', 'l', 'O', 'V', 'E', 'y', 'O ', 'U'}; the method of initialization one by one is essentially the same as that of the numeric array initialization. You can also perform full initial value assignment and incomplete initial value assignment, however, when values are not completely assigned, elements that are not assigned values are assigned spaces. The length description can be omitted when an initial value is assigned to all elements. For example: Char C [] = {'C', '', 'P', 'R', 'O', 'G', 'R', 'A ', 'M'}; the length of the C array is automatically set to 9. (2) Initialize an array of string constants. For example: Char C [] = {'C', '', 'P', 'R', 'O', 'G', 'R', 'A ', 'M'}; can be written as: Char C [] = {"C program"}; or remove {} and write as: Char C [] = "C program ";
Character array Initialization