Tricky pointer question

后端 未结 4 946
北荒
北荒 2021-02-07 15:17

I\'m having trouble with a past exam question on pointers in c which I found from this link, http://www.cl.cam.ac.uk/teaching/exams/pastpapers/y2007p3q4.pdf

The question

4条回答
  •  天命终不由人
    2021-02-07 15:27

    pps is a pointer to pointer to short,

    which means that *pps is a pointer to short (or array of shorts),

    (*pps)[1] is just like *(*pps + 1) [pointers arithmetic],

    and &(*(*pps + 1)) is the address of *(*pps+1),

    or, in other words - (*pps+1) (which is a pointer to short).

提交回复
热议问题