The line in question seems perfectly fine to me, the size of struct container
is well-known, because of its definition. The only size not known is the size of the arrays that the pointers in the struct will eventually point to, but that doesn't affect the size of the pointers themselves and thus also not the struct's size.
The only issue I see is here:
current_container->linked_to_container[0][j] = &(allcontainers[next_container]->labels[0]);
linked_to_container[0][j]
is of type int*
, but labels[0]
is of type int*
and therefore &(labels[0])
is of type int**
. I am not sure what you try to accomplish here, but you probably need another index to labels[0][...]
or &
shouldn't be there.