1,493 views
1 votes
1 votes

Tell me the difference :
&(arr+1)   and    &arr+1 

2 Answers

5 votes
5 votes
The name of the array gives the address of the 0th element. So if we add 1 to the name of the array it will contain the address of the next element.

But if we look at the other one "&arr" this gives the address of the entire array and now when we increment it by one it will contain the address of the second array of same size.
edited by

Related questions

801
views
1 answers
0 votes
aditi19 asked Sep 13, 2018
801 views
what is wrong with this code? It shows segmentation fault#include<stdio.h>#include<stdlib.h>void main(){ int i,j,count=1; int **a=(int**)malloc(3*sizeof(int*)); for(i=0; i<3; ... ("%d ",a[i][j]); } printf("\n"); }}
640
views
1 answers
0 votes
shivam sharma 5 asked Aug 28, 2018
640 views
give the complete solution with explanationint main(){ int arr [2] [2] [2] = {10,2,3,4,5,6,7,8}; int *p, *q; p = &arr[1] [1] [1]; q = (int*) arr; printf("%d ,%d \n",*p ,*q); return 0;}
5.8k
views
8 answers
13 votes
Na462 asked Aug 22, 2018
5,799 views
Consider a 2 dimensional array A[40...95,40...95] in lower triangular matrix representation. The size of each element of array is 1 Byte.If array is implemented in memory ... base address as 1000,the address of A[66][50] is .....Ans. 1361
1.1k
views
1 answers
1 votes
Balaji Jegan asked Jun 27, 2018
1,054 views
Can anyone please verify whether I have calculated the addresses correctly or not?