`c_void_p`: The Opaque Pointer's Power

`ctypes.c_void_p` represents the C `void*` type, functioning as a generic pointer that can point to any data type. It's especially useful for handling opaque pointers, where the exact data structure isn't known to Python, or for callbacks where the C function expects a generic pointer. Its value is represented as an integer in Python.

Sources

Open the full topic