PyDocs

Nav

Generic Operating System Services

cast

ctypes

function (source)
  • cast(obj, type)
This function is similar to the cast operator in C. It returns a new instance of type which points to the same memory block as obj. type must be a pointer type, and obj must be an object that can be interpreted as a pointer.
1 Example
>>> a = (c_byte * 4)()
>>> cast(a, POINTER(c_int))
<ctypes.LP_c_long object at ...>
>>>
from the Python docs
See Also
No see-alsos for ctypes/cast
0 Notes
No notes for cast