3 karma · joined Jun 17, 2020 (6y ago) · 1 submissions
comment 6y ago · link · parent
So when the array is declared
char alphabet[10] = {'a', 'b', 'c', 'd', 'e'};
What the alphabet variable "holds" can be seen (this is not exactly true) as a pointer to the array.Then when you do
alphabet_pointer = alphabet;
You just assign to alphabet_pointer the position in memory of the (first element of) alphabet.
Then alphabet_pointer can be dereferenced to access the content of the array (and not the address of a pointer to the array).
__
* There are some situations where an array name is not considered as a pointer to the array. Notably &array gives you back the address of the array : &array == array.
https://stackoverflow.com/questions/17752978/exceptions-to-a...