(no title)
aloisklink | 2 years ago
struct KeyedEntry {
struct Entry entry;
char key[]; // flexible array member
};
It's not too much more useful when just using `char`, but for other data types, it's a bit cleaner, since it handles alignment/padding better.[1]: https://en.wikipedia.org/wiki/Flexible_array_member, or https://beej.us/guide/bgc/html/split/structs-ii-more-fun-wit...
_Edit_: Something like this might not be suitable for the author, since they did mention how they wanted each `struct` to have a fixed size.
No comments yet.