Python 的 ctypes.c_long 是 64 位系统上的 64 位吗? [英] Is Python's ctypes.c_long 64 bit on 64 bit systems?

查看:27
本文介绍了Python 的 ctypes.c_long 是 64 位系统上的 64 位吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 C 中,long 在 64 位系统上是 64 位.这是否反映在 Python 的 ctypes 模块中?

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

推荐答案

long 的大小 取决于内存模型.在 Windows (LLP64) 上为 32 位,在 UNIX (LP64) 上为 64 位.

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

如果您需要 64 位整数,请使用 c_int64.

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

如果你需要一个指针大小的整数,使用 c_void_p(该值表示为整数").

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

这篇关于Python 的 ctypes.c_long 是 64 位系统上的 64 位吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆