Quote Originally Posted by roaan View Post
I am new to c and i have been trying to understand the fundas. i tested a program on arrays which goes like this:

insert
Code:
void main(){

	int n[3][3]= {2,4,3,6,8,5,3,5,1};
	printf("\n%d \n%d \n%d \n%d \n%d",n, *n, &n, *(*(n+1)+0),n[2][2]);
}


The output that i get is this:
1244692
1244692
1244692
6
1

I had a question that n contains the base address of the array and *n should contain the value at address contained in n which should be the first element in the array.

Also &n is also the same value is this value not supposed to be different?
n - the name of an array gives the base address of the array.
*n - Look it like this (*(n+0)+0) which is nothing but the address of n[0][0] if it would have been **n, it would have printed the very first element.
&n - The array 'n' is itself stored at some place which is the same as from where the first element starts so &n and n print the same thing but it'll be better for you to check it by printing "n+1" and "&n+1", you will know what I mean and what's the differnce between "n" and "&n".
By the way dont use void main.