2 karma · joined Feb 28, 2019 (7y ago) · 2 submissions
comment 6y ago · link · parent
typedef struct { size_t len; uint8_t data[]; } ByteBuf;
ByteBuf *b = malloc(sizeof(*b) + sizeof(uint8_t) * array_size); b->len = array_size;