0 votes 0 votes int main() { static int a[]={0,1,2,3,4}; static int *p[]={a,a+1,a+2,a+3,a+4}; printf("%u%u%d",p,*p,*(*p)); } saipriyab asked Sep 28, 2017 saipriyab 412 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes let us assume integer is of 2 bytes and pointer is of 4 bytes........i am considering some addresses of arrays./ sandeepjkh answered Sep 28, 2017 sandeepjkh comment Share Follow See all 3 Comments See all 3 3 Comments reply saipriyab commented Sep 28, 2017 reply Follow Share I have a doubt int p,i=0; p=&i; printf("%d",p) ; will print address of variable i So in the above code static int *p[]={a,a+1,a+2,a+3,a+4}; printf("%d",p); is printing base address of p array why it is not printing address of array it is pointing 0 votes 0 votes Nirmal Gaur commented Sep 29, 2017 reply Follow Share here p is not pointing to a single variable, it acts as an array of pointers and as the mnemonic(or name) of an array represents its base address, p would give us base address of that array of pointers... 0 votes 0 votes sandeepjkh commented Sep 29, 2017 reply Follow Share P is an array pointer which contains the addresses of array A.....and this array p has a base address....so print(p) means print base address of p.....not only in this case but in another cases also if an array A is given and we write print(A) it should print base address of A not the addresses the array A is pointing to. 0 votes 0 votes Please log in or register to add a comment.