News for hackers. Stuff that matters.
Re:C Strings and my slow descent to madness by gpderetta on Thursday April 06, 2023 @10:13AM (#35468555)
The worst part of C strings is that they tend to show up in APIs (especially system calls). This make interoperability with other languages harder than it should m
Re:C Strings and my slow descent to madness by ziml77 on Friday April 07, 2023 @01:33AM (#35478392)
This is why I hate them too. You can use a custom length + pointer type for representing strings in your own code, but interfacing with other libraries and the OS almost always requires having a null-terminated string. It forces you to make copies just to tack on the null terminator.