ctypes pointer from offset into array?

Carl Banks pavlovevidence at gmail.com
Sat Dec 5 04:13:37 EST 2009


Is there a way to get the pointer to an array offset in ctypes.
Example, say I define an array like so:

xfer = (c_char*bufsize)()

How would I get a pointer to then nth byte (equivalient of &xfer[n])?
I guess I would have expected xfer+n to work, but it doesn't.


Carl Banks



More information about the Python-list mailing list