3 ms·
Yep, but this one has not the usual layout of struct+pointer (that's the whole point), and I'm not sure it qualifies as "yet another" since it was written in 20
by antirez 13y ago
Yep, but this one has not the usual layout of struct+pointer (that's the whole point), and I'm not sure it qualifies as "yet another" since it was written in 2006.
- FooBarWidget 13y agoYou're right, sorry. I only scanned the document, saw the struct, and closed the tab. The way you use a header before the data is similar to how Ruby represents its strings internally.
- pacaro 13y agoIt appears to me to be "yet another" because the length before the string approach is usually referred to as a b-string. windows (for example) has had a comprehensive b-string library (type is called BSTR) for about 20 years - due to it's age and provenance it has the downside of thinking a character is a 16-bit value...
- shadowfox 13y agoJust to add a reference to the parent: http://www.johndcook.com/cplusplus_strings.html http://www.johndcook.com/cplusplus_strings.html (The article is mildly interesting by itself)