Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Out of the top of my head the only thing that makes '\0' terminated strings special in C is that it's the way string literals are represented. It would be trivial to recode all of string.h using addr + len instead of nul terminated.

exactly, anywhere you would have if(str[i] == NULL) you replace with if (str.s + i == str.end)



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: