trayres 0 Newbie Poster

Hi everyone -
I've got a C function that doesn't have a return type. Instead, its argument is a pointer to an array of doubles (the array is four doubles long - so the argument to the function is a pointer to the first one).

So this function takes this pointer, changes the values of the 4 doubles that are located by it, and exits.

I need to somehow get to those 4 doubles, but all I know is the double pointer that I pass in. I can't...figure out how to make it work with ctypes. I'd be trying to retrieve the values, that start at one memory address, and are separated by sizeof(double) bytes. This would be easy in C - but I'm clueless about how to accomplish it in python!

Also, I'm having trouble accessing sizeof() in the C standard library. I seem to be able to get printf to work, but sizeof() gives me an error.

I've only been working with ctypes for two days, and am stuck. Any help is really, really appreciated.
I'm trying to create wrappers for a scientific instrument so that we can automate testing with python scripts, rather than running individual tests by hand using the proprietary software/interface that came with the device (far, far too slow).

Running XP, 32-bit.
Thanks all!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.