in Programming in C edited by
503 views
2 votes
2 votes

If $x$ is a one dimensional array, then

  1. $^*(x+i)$ is same as $^*(\&x[i])$
  2. $\&x[i]$ is same as $x+i-1$
  3. $^*(x+i)$ is same as $^*x[i]$
  4. $^*(x+i)$ is same as $^*x+i$
in Programming in C edited by
503 views

3 Answers

2 votes
2 votes

*(x+i) means i th index of array x which is similar to x[i] 

and *(&x[i])  as it is known that * and & are complement of each other so it will give x[i] only 

So both are same no need to check further options

 

Correct Answer is A

0 votes
0 votes

Name of array is the address of the first element in the array , so x is address and (x+i) is address of i th element in the array, *(x+i) is x[i] which is same as *(&x[i])

So Answer is : A

0 votes
0 votes

option a
*(x+i) is same as *(&x[i])
*(&x[i])= *(&(*(x+i))) = *(x+i)

option b
&x[i]=&(*(x+i))=x+i != x+i-1
so b is wrong

option c
*(x+i)=x[i]!=*x[i]
so c is wrong

option d
(*(x+1)=x[1] )!=(*x+i or x[0]+i)
so d wrong

OPTION A CORRECT