ctypes and flexible (zero-length) arrays

Dear lazyweb, I’ve been racking my brain trying to get information out of the following C struct in a nice way when using ctypes: struct Foo { unsigned int length; char name[]; }; I wrote a little C function to get instance of the struct easily into python: struct Foo * put_name(char *name) { struct …

Continue reading ‘ctypes and flexible (zero-length) arrays’ »

Share