The name of a one-dimensional array is a pointer constant. It stores the address of the first element of a one-dimensional array.
# Include <stdio. h> int main (void) {int A [5]; // A is the array name. 5 is the number of array elements. The element is the variable A [0] -- A [4] // int A [3] [4]; // three rows and four columns A [0] [0] are the first element a [I] [J], row I + 1 J + column 1 int B [5]; // A = B; // error A is a constant printf ("% # x \ n", & A [0]); printf ("% # x \ n ", a); Return 0;}/* the output result in VC ++ 6.0 is: ---------------- 0x12ff6c0x12ff6cpress any key to continue ------------. Conclusion: one-dimensional array name one-dimensional array name is a pointer constant which stores the address of the first element of one-dimensional array */
Relationship between pointer and lower mark
# include <stdio.h>int main(void){ int a[5] = {1,2,3,4,5}; int i; for (i=0; i<5; ++i) printf("%d\n", a[i]); //a[i] == *(a+i) return 0;}
Demo2.
# include <stdio.h>int main(void){ int a[5] = { 1,2,3,4,5}; for( int i = 0 ; i < 5 ; i++ ){ printf("%d \n" , a[i]); } for(i = 0 ; i < 5 ; i++ ){ printf("%d \n" , *(a+i)); }return 0 ;}