Please explain the difference

后端 未结 4 720
攒了一身酷
攒了一身酷 2020-12-30 15:33

i have a program about 2-D arrays

base adress is 8678

#include
#include
         


        
4条回答
  •  醉话见心
    2020-12-30 15:51

    You can figure this out with the help of this equivalence: X[Y] === *(X+Y)

    Since *(arr+1) === arr[1], arr+1 === &arr[1]

    Similarly, &arr+1 === &((&arr)[1])

    What is (&arr)[1]? Well, (&arr)[0] === *&arr === arr, that is, the 3x3 array itself, so (&arr)[1] is the 3x3 array following that, and &arr+1 === &((&arr)[1]) is the address of the 3x3 array following &arr ... a pointer to the byte just past the entire array.

提交回复
热议问题