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))); ```
here, the result of malloc is the entire structure pointer