4 ms·
Yes, those are a dime a dozen. E.g. GString[1] is one example. Rather than strict "Pascal strings" like the sibling comments rightly points out would be stupid,
by avar 7y ago
Yes, those are a dime a dozen. E.g. GString[1] is one example. Rather than strict "Pascal strings" like the sibling comments rightly points out would be stupid, they're a light struct with a char/size_t len (and usually also size_t alloc_len). This allows for skipping strlen() on them before e.g. copying, while using them as a C string by getting directly at the char.
1. https://developer.gnome.org/glib/stable/glib-Strings.html#GString https://developer.gnome.org/glib/stable/glib-Strings.html#GS...