[ctypes-users] [ctypes-user] : Problem passing params to a function
Brought to you by:
theller
From: Laurent R. <lau...@gm...> - 2009-04-15 14:03:07
|
Hi, I'm using ctypes for a few days and I'm really enjoying it. But today I face a problem I'm not able to find a solution for. The library I want to map defines a function as : char *the_c_function(const char *str, int *sp) When I read the part of the C code which uses this function I can see : int ksiz kbuf = the_c_function(key, &ksiz); I already manage to use a number of the library functions but none of them used the memory address of the object. I tried : ksiz = ctypes.c_int mylib.the_c_function(key, ctypes.addressof(ksiz)) but I always get an error about ctypes.addressof(ksiz) not being of the wright type. Any idea ? Regards, Laurent |