I have understood the concept of pointers and arrays but still one thing is confusing:
If I have one dimensional array for eg.
Code:
int x[]={10,20,30};
the x stores the address of is first element i.e x=&x[0][0] but how? This shows that x is a variable that also gets some memory space like x[0],x[1] or any other variable, which contains the address. Am I right? but this does not seems to be true. In C language the array name does not get any space in the memory then how can it has a value..I think anything which has the value gets the space in the memory.
In two dimensional array,
Code:
int num[][]={{10,20,30},{40,50,60},{70,80,90}};
num[0] stores the address of the num[0][0],
num stores the address of the num[0],
*num=num[0]
*(*num)=num[0][0]
I have not understood these. I think only num[0][0],num[0][1],num[0][2].....gets the memory. How num, num[0],num[1] gets the memory???
I have gone through some of the topics here but could'nt find them useful.