Answer the question
In order to leave comments, you need to log in
Array in C + pointer?
In general, thought about the idea.
Here for example I create an array:
int a[3] = {1, 2, 3};
Output : a
Output : &a
and : &a[0] the
same way . hmm.
after all, in fact the variable "a" contains the address of the zero element of the array, right?
it means that this variable "a" was created in memory, or rather a pointer, and it contains the address of the zero element of the array.
but then when outputting :
&a and &a[0] different addresses should be output. so what happens.
compiler hides this variable from us?
Answer the question
In order to leave comments, you need to log in
because in fact the variable "a" contains the address of the zero element of the array, right?
there in one case just a pointer to the null element.
and in the other case, a reference to a pointer to a null element (a reference to a pointer is essentially the same as a pointer to a pointer).
if the array were dynamic, it would matter in terms of memory allocation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question