r/cprogramming • u/Xaneris47 • Aug 17 '26
C Strings: A 50-Year Mistake
https://longtran2904.substack.com/p/c-strings-a-50-year-mistake?r=8qz2zb&utm_campaign=post&utm_medium=web
212
Upvotes
r/cprogramming • u/Xaneris47 • Aug 17 '26
View all comments
1
u/Humble-Captain3418 Aug 18 '26
With length-based strings you will find that functions such as
strtok(),strchr()orstrstr()are very, very annoying to implement, because their return values would not be usable as inputs to regular string operations... Except if you construct a new string to return, which you then need tomalloc()/free(). Hooray for efficiency?