sizeof (int) == sizeof (void*)?

后端 未结 10 876
有刺的猬
有刺的猬 2020-12-03 01:50

Is there an integer type with the same size as pointer? Guaranteed on all microarchitectures?

10条回答
  •  有刺的猬
    2020-12-03 02:48

    According to this Wikipedia page, in C99 your stdint.h header might declare intptr_t and uintptr_t, but then that of course requires

    • C99
    • A compiler implementor which has chosen to implement this optional part of the standard

    So in general I think this one is tough.

提交回复
热议问题