you can also use flexible array members for that: ```c typedef struct { int element_count; int buffer[]; }, ctx; // later ctx *t = malloc(sizeof(*t) + element_count * sizeof(*(t->buffer))); ```
pros (probably): you can get the sizeof buffer (maybe) and now its local cons (also probably): now it can be more/less expensive to copy to parameters if its not passed as a ptr