1

这些变量类型在 python 中的 ctype 等效项是什么:

signed short iHD;
word iThem;

词定义为:

typedef unsigned short word  

无符号 16 位类型的定义

到处找,但我找不到等效的 ctype

谢谢!

4

2 回答 2

0

signed short iHDc_short

word iThem;c_ushort

请注意,这些是short您的平台定义的类型,可能是 16 位,但不一定!

如果您想要 16 位类型,请使用c_uint16c_int16

于 2012-05-16T18:43:02.453 回答
0

你看过文档吗?

您正在寻找c_shortc_ushort

http://docs.python.org/library/ctypes.html#ctypes.c_short http://docs.python.org/library/ctypes.html#ctypes.c_ushort

于 2012-05-16T18:44:03.040 回答