3 ms·
Why not abandon \0-terminated string and pass the length of strings as an additional parameter?
by legulere 7y ago
Why not abandon \0-terminated string and pass the length of strings as an additional parameter?
- carapace 7y agohttps://stackoverflow.com/questions/25068903/what-are-pascal-strings https://stackoverflow.com/questions/25068903/what-are-pascal...
- legulere 7y agoPascal strings prefix the string with the length. What I'm arguing for is more like fat pointers, where the length is stored at the same location as the pointer. Something that is already standard to do in C for binary data.
- papermachete 7y agoBecause floating variables are ambiguous and you can lie about length (unintentionally too).