This doesn't look like a function. What is this?

前端 未结 5 2008
無奈伤痛
無奈伤痛 2021-01-06 05:02

A friend asked me to write a function in C to return the 100th element of an array. I\'m not very familiar with C, so I wasn\'t sure how to make a generic function that coul

5条回答
  •  误落风尘
    2021-01-06 05:06

    When using pointers, pointer[ index ] and index[ pointer ] are actually the same. It's not a function, its a regular operator; its the same as array[ GetHundredthElement ] or array[ 100 - 1 ].

提交回复
热议问题