How to initialize a structure with flexible array member
No, flexible arrays must always be allocated manually. But you may use calloc to initialize the flexible part and a compound literal to initialize the fixed part. I’d wrap that in an allocation inline function like this: typedef struct person { unsigned age; char sex; size_t size; char name[]; } person; inline person* alloc_person(int a, … Read more