-1

If we declare an array, like:

int arr[3] = {1,2,3};

and if we try to print the value of arr and &arr, it shows the same result. Why is it like that? If arr is holding the address of the first element, shouldn't it have an address of its own??

  • 1
    Imagine you have two laser pointers: one red, one green. Red pointers point to train carriages (`arr`); green pointers point to trains (`&arr`). Now set the red pointer to the first carriage of the passing train and the green pointer to the whole train ... do the pointers "hit" in the same spot? – pmg May 08 '22 at 07:25
  • @Mat, i tried to mean that, arr is holding the address of the first element somewhere in the memory in a block, shouldn't that block also have an address? – Fahim Montasir May 08 '22 at 07:27
  • You might like section 6 of the [comp.lang.c faq](http://c-faq.com/). – pmg May 08 '22 at 07:28

0 Answers0