的sizeof(INT)==的sizeof(void *的)?

问题描述:

是否有具有相同的大小作为指针的整数类型?保证所有的微架构?

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

据this维基百科页面,在C99的stdint.h头的可能的声明intptr_t和uintptr_t形式,但随后那当然需要

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

  • 已选择实施标准
  • 这个可选部分编译器实现者
  • C99
  • A compiler implementor which has chosen to implement this optional part of the standard

所以一般我觉得这个是很难的。

So in general I think this one is tough.