cytpes **int

Diez B. Roggisch deets at nospam.web.de
Mon Apr 28 23:55:15 CEST 2008


VernM schrieb:
> I am using ctypes to wrap a set of functions in a DLL. It has been
> going very well, and I am very impressed with ctypes. I want to call a
> c function with a signature of: void func(int **cube), where the array
> if ints in cube is modified by func. I want to setup cube with int
> values, and access them after the call to func. I unerstand how to
> setup the ctypes array, but how do I pass **cube to the function, and
> how do I access the results?

it should be simple.

use something like (untestet):

b = POINTER(c_int)()
func(byref(b))


Or

a = c_int()
b = pointer(a)
func(byref(b)

Or

b = POINTER(c_int)()
func(pointer(b))


Diez



More information about the Python-list mailing list