I have a C library that is wrapped in a pyhton module. Everything works just fine, but I don't know what type of variable I have to declare (using ctypes) for a certain function (see the following documentation of the function). Just to make things clear I don't know anything about C, C# or C++
I tried it using the following code (and some slightly different versions):
import ctypes as ct
dev_name = ct.c_char(20)
dev_name_size = (ct.c_uint*20)()
ven_name = ct.c_char(20)
ven_name_size = (ct.c_uint*20)()
llt.get_device_name(hLLT, ct.byref(dev_name), ct.byref(dev_name_size), ct.byref(ven_name), ct.byref(ven_name_size))
I then get the following error:
ctypes.ArgumentError: argument 3: <class 'TypeError'>: wrong type
so I know that the name_size-variables has the wrong class, but I don't really know which the correct one is/how to declare it in python. Also how important is it correct that the number behind ct.c_char (in this case 20) determines the chars length or what does it do (is it even necessary to give a number here?