What is uintptr_t data type

后端 未结 5 774
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 04:15

What is uintptr_t and what can it be used for?

5条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 05:06

    It's an unsigned integer type exactly the size of a pointer. Whenever you need to do something unusual with a pointer - like for example invert all bits (don't ask why) you cast it to uintptr_t and manipulate it as a usual integer number, then cast back.

提交回复
热议问题