Does pointer arithmetic have uses outside of arrays?

后端 未结 7 1980
青春惊慌失措
青春惊慌失措 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:38

    If you follow the language standard to the letter, then pointer arithmetic is only defined when pointing to an array, and not in any other case.

    A pointer may point to any element of an array, or one step past the end of the array.

    0 讨论(0)
提交回复
热议问题