In ctypes, what is the difference between pointer and byref? They both seem like a way to pass a pointer to a function, for example as an output parameter.
ctypes exports the byref() function which is used to pass parameters by reference.
Functionally, they are equivalent.
However, the python docs do point out that
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With