gpt4 book ai didi

python - ctypes.pointer、ctypes.POINTER 和 ctypes.byref 之间有什么区别?

转载 作者:太空狗 更新时间:2023-10-29 17:20:46 28 4
gpt4 key购买 nike

在ctypes中,pointer和byref有什么区别?它们似乎都是将指针传递给函数的一种方式,例如作为输出参数。

最佳答案

在功能上,它们是等价的。

然而,python docs请指出

pointer does a lot more work since it constructs a real pointer object, so it is faster to use byref if you don't need the pointer object in Python itself.

关于python - ctypes.pointer、ctypes.POINTER 和 ctypes.byref 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12281306/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com