Sixth. Referencing an array to process bulk data
1. Definition of array: type-character array-name [constant-expression]
1) define an array in the main function, the constant expression cannot contain the variable
int a[3+5]; // Legal int N; int a[n]; // Not legal
2) in the function being called, the length can be a variable or a very expressive expression
void int N) { int a[2// Legal, because the value of n is constant when executing a function }
3) in the C language, the array name represents the starting address of the array, and if the input entry in the SCANF function is an array of characters, do not add the address character &
2. Initialization of arrays
If you specify an array's length and initialize it when you define a numeric array, the system automatically initializes the array elements that are not initialized by the initialization list.
is 0 (if it is a character array, it is initialized to ' \ s ', and if it is a pointer-type array, it is initialized to null (null pointer) )
int a[1,2,3,4,5}; // only the first five elements are initialized, and the last five elements are 0
3. Initialization of two-dimensional arrays
int a[3[4] = {{1},{5},{9/* Post-assignment element 1 0 0 0 5 0 0 0 9 0 0 0 */
int a[3[4// define an array of three rows four columns a[3] [43// Illegal, array starting from 0, does not exist a[3][4]
"C Language Programming (fourth Edition)" Reading Experience (ii)