For example:
pointer = ctypes.POINTER(ctypes.c_ulong)
b = pointer(ctypes.c_ulong(20))
What do I get the int value of b?
You mean, dereference b
to get that c_ulong(20)
? That's b.contents
. Or do you mean, see where in memory that pointer happens to point, as if it was an integer rather than a pointer? That's ctypes.cast(b, ctypes.c_void_p).value
.
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