Y’all I have no idea why C has a reputation for being hard to use correctly, this seems really straightforward…pic.twitter.com/8d0Er7BU29
You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more
Assuming the two are wrapped together in one struct, how do you mess it up
That is a good approach to avoid human error but at some point you need to unpack & use the values, & it's easy to accidentally write bar.base but bah.len, etc.
unsubscribe
Will do. Wasn't sure if continuing this would be interesting to you or not.
Personally I prefer null-terminated as public interface except in special cases where it's inefficient, base+len internally where it helps.
If public API allows base+len, you risk the possibility of internal nul bytes which will be dangerous if you use the string in pathnames & other similar contexts.
OCaml uses Pascal strings but passes then to C standard functions. It's weird. “[print_string s] prints [s] but stops at the first null character inside [s]” is a crappy specification for a function that's supposed to print a string.
Yeah that's the kind of thing that makes them dangerous. Also base+len != Pascal. Former has len outside, shareable content. Latter embeds a (usually undersized) len at start of content.
Most users should be using an abstraction built over (base,len) that does bookkeeping for them, anyway.
Only if your code is really heavy on string ops. Otherwise it's just an extra layer of complexity. Many uses of strings get by fine with just treating them as immutable inputs, possibly with a few snprintfs internally.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.