|
|
|
|
|
by ori_b
5279 days ago
|
|
You can allocate the string with one malloc: RString *s = malloc(sizeof(RString) + length); /* allocate 'length' bytes extra memory past the end of 's' */
s->data = s + 1; /* to the extra memory past the start of the string struct */
|
|