I have look on many places for this, and have tried using cast, but had no success.
I have a struct in c like:
struct t{
int x;
struct y[0];
};
How would I resize the array of struct y? I tried the other types of this issue on SO (does python ctypes supports size-0 array?), but kept on getting this error.
TypeError: incompatible types, y_Array_20 instance instead of y_Array_0 instance
My other answer you reference just has an example of returning a sized structure, and as the comments in that answer indicate, using a sized array time prevents accidently reading past the end of the array. This example below shows a way to size the array whether the DLL function returns one or the user creates one and passes it in.
test.c:
test.py:
Output: