Hello all! I'm having difficulties accessing the information in a returned struct object. I'm quite new to C/C++, but I've had plenty of experience with C#, so I think I have my foot in the door.

I have a struct defined as

class PhotoInfo(ctypes.Structure):
    _fields_ = [
        ('times', ctypes.POINTER(ctypes.c_double)),
        ('fluxes', ctypes.POINTER(ctypes.c_double)),

with the restype defined like

def main():
    lib = ctypes.cdll.LoadLibrary('photoroutine.so')

    start = lib.start
    PhotoInfoPtr = ctypes.POINTER(PhotoInfo)
    start.restype = PhotoInfoPtr

But when I call

phin = start()

I can't get to the time and flux info the returned object has. I've tried using


but it just gives me a location; i.e. <__main__.LP_c_double object at 0x159fef0>

How do I get the actual array of times and fluxes?

Thanks for your time!

Nicholas Earl
Graduate Research Assistant
San Diego State University