I'm trying to pass a structure pointer to the API wrapper, Where the struct is containing float pointer member. I'm not sure that how we can pass float pointer value to the structure.
/Structure/
class input_struct (ctypes.Structure):
_fields_ = [
('number1', ctypes.POINTER(ctypes.c_float)),
('number2', ctypes.c_float),
#('option_enum', ctypes.POINTER(option))
]
/wrapper/
init_func = c_instance.expose_init
init_func.argtypes = [ctypes.POINTER(input_struct)]
#help(c_instance)
inp_str_ptr = input_struct()
#inp_str_ptr.number1 = cast(20, ctypes.POINTER(ctypes.c_float)) # want to pass pointer
inp_str_ptr.number1 = 20 # want to pass as float pointer
inp_str_ptr.number2 = 100
c_instance.expose_init(ctypes.byref(inp_str_ptr))
c_instance.expose_operation()