Assign value to field in array of nested structs
<p>I have a function <code>test</code> that accepts a pointer to a structure. How can I set the value of a field in a structure in the nested structure array? The structures are created and deleted elsewhere, I just want to set the value.</p>

<pre><code>typedef struct {
    int a;
} inner_struct_t;

typedef struct {
    int b;
    inner_struct_t innerStructsArr[];
} outer_struct_t;

void test(outer_struct_t *outerStruct);

void test(outer_struct_t *outerStruct) {
    outerStruct-&gt;b = 123;                       // set a value in the outer struct
    (outerStruct-&gt;innerStructsArr)[0].a = 456;  // but this DOESN'T work
}
</code></pre>