hi i'm trying to understand the relation between pointers and arrays but i have a problem that i can't figure out myself.
i read that the name of an array in c is the adress of the first element of the array , but if that's true , i don't understand why this simple code doesn't work.
Code:
#include <stdio.h>
int main()
{
int array[4][3] = { {1,2,3} , {4,5,6} , {7,8,9} , {10,11,12} };
printf("%i\n",array);
printf("%i\n",&array[0][0]);
printf("%i\n",*array);
printf("%i\n",*(&array[0][0]));
return 0;
}
the problem is that when i try to dereference "array" the computer prints the adress of the first element instead of "1" whereas dereferencing "&array[0][0]" works perfect.
can somebody please explain to me what mistake i am making?