Given I have a struct something like this:
struct arr {
int len;
void *item[]; // still playing with this
};
typedef struct arr my_array;
I'm wondering how you initialize it.
my_array foo = { 0, 1000 }; // 1000 spaces reserved.
// or perhaps...
my_array foo = { 0, [1000] };
Because when you have a regular array, you specify the size like this:
int anarray[1000];
So I was thinking you could do that to initialize the pointer value in the array struct above.
Maybe even
foo->item[1000];
I don't know. Wondering if anything like that is possible.
{size_t len; type_x item[1];}and then create/expand the array (GNU GCC allows you to useitem[0]which could simplify some calculation.