2 ms·
I'm not anti-length-variable! I'm saying, which of struct bytes { size_t size; unsigned char *data; }; struct bytes { size_t size; unsigned char data[]; };
by morelisp 4y ago
I'm not anti-length-variable! I'm saying, which of
struct bytes { size_t size; unsigned char *data; };
struct bytes { size_t size; unsigned char data[]; };
you want depends heavily on what you're doing with the string(s) - plus other common variations like len+cap instead of just size, SSO, etc.
So if you can't standardize the data structure, what's the common interface? A function that takes a pointer and a length - which is what we already have. So everyone in this thread appealing to the C standardization process or stdlib to do something wants instead - what, exactly?