I am a total beginner to C so please, work with my ignorance. Why does a normal pointer
int* ptr = &a;
has two spaces in memory (one for the pointer variable and one for the value it points to) and an array pointer int a[] = {5};
only has one memory space (if I print out
printf("\n%p\n", a)
I get the same address as if I printed out: printf("\n%p\n", &a)
.
The question is, shouldn't there be a memory space for the pointer variable a
and one for its value which points to the first array element? It does it with the regular pointer int* ptr = &a;