/* File: array-address.c Description: This code prints out various address related items in an array. It also shows the equivalence between the plain name of array in this case ``numbers'' and the use of notation ``&(numbers[0]). Revised from program 8.10 in Bronson page 4 */ #include #include #define NUMELS 20 int main() { int numbers[NUMELS]; printf("The starting address of the numbers array using notation &numbers[0] is: %p\n", (void *)&numbers[0]); printf("The storage size of each array element is: %ld\n", sizeof(int)); printf("The address of element numbers[5] is : %p\n", (void *)&numbers[5]); printf("The starting address of the array,\n"); printf(" using the notation numbers, is: %p\n", (void *)numbers); printf("Therefore, the notation &numbers[0] and numbers are equivalent!\n"); return EXIT_SUCCESS; }