4 ms·
Null-terminated strings is an endless source of bugs in C progras. I with C used fixed size strings (may be with varint instead of 8-bit length field) or Pascal
by citrin_ru 2y ago
Null-terminated strings is an endless source of bugs in C progras. I with C used fixed size strings (may be with varint instead of 8-bit length field) or Pascal got more tratcion.
- ziml77 2y agoAnd very annoyingly they can't be sliced except if you are only trimming off the front. If you need to chop off anything at the end, you either need to make a copy or do an icky and not thread safe hack of swapping out a character for the null character and then swapping it back when you're done.