I know that a pointer in C language is a variable that holds an address. for example:
int myVar;
int *p;
p = &myVar;
printf("%p\n", p);
printf("%p\n", &p);
The output will be two different addresses, the first one is the address of myVar and the second one is the address of the pointer itself which means a pointer is a variable also and have an address in memory (Correct me if I'm wrong)
But my question is about arrays, for example we have this code:
int myArray[10];
so here I thought myArray is a pointer also that holding the address of the starting point of myArray which in this case is myArray[0], so when I print address of myArray[0] and myArray I get same result:
printf("%p\n", &myArray[0]);
printf("%p\n", myArray);
Now the confusing part for me is here when I try to print the address of myArray itself:
printf("%p\n", &myArray);
Here I get the same results I was expecting to get another address like pointers.Is myArray a label or something?