Is Python's ctypes.c_long 64 bit on 64 bit systems?

前端 未结 4 836
囚心锁ツ
囚心锁ツ 2020-12-19 05:20

In C, long is 64 bit on a 64 bit system. Is this reflected in Python\'s ctypes module?

4条回答
  •  执念已碎
    2020-12-19 06:15

    The size of long depends on the memory model. On Windows (LLP64) it is 32-bit, on UNIX (LP64) it is 64-bit.

    If you need a 64-bit integer, use c_int64.

    If you need a pointer-sized integer, use c_void_p (“The value is represented as integer”).

提交回复
热议问题