Re:Str: Yet another string library for C language
by WalterBright on Wednesday November 25, 2020 @05:36PM
(#25215064)
D uses "phat pointers" for strings, aka a length/pointer pair. Over the years, this has proven to be simple, efficient, and resistant to errors. It means array bounds checking can be automatically done. It enables efficient slicing.
String literals also have an extra 0 appended, making it transparently easy to still pass strings to C functions like printf.
String literals also have an extra 0 appended, making it transparently easy to still pass strings to C functions like printf.