4 ms·
Bingo: "Length + data strings have various disadvantages. For one thing, how wide should be the length? Two bytes? Four? Eight? "
by hyperliner 12y ago
Bingo: "Length + data strings have various disadvantages. For one thing, how wide should be the length? Two bytes? Four? Eight? "
- andreasvc 12y agoThat's easy, it should be of type size_t. Yes that is wasteful for short strings, but then again I believe null-terminated strings are the most widespread and worst case of premature optimization, and correctness & safety should take precedence.