Does pointer arithmetic have uses outside of arrays?

后端 未结 7 1992
青春惊慌失措
青春惊慌失措 2020-12-17 15:00

I think I understand the semantics of pointer arithmetic fairly well, but I only ever see examples when dealing with arrays. Does it have any other uses that can\'t be achie

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 15:25

    Pointer arithmetic is only defined on arrays. Adding an integer to a pointer that does not point to an array element produces undefined behavior.

提交回复
热议问题