2 ms·
> Null-terminated strings are useful for buffering values of unknown length (e.g. copying from a network stream). That doesn't seem like a good example. The da
by thaumasiotes 8y ago
> Null-terminated strings are useful for buffering values of unknown length (e.g. copying from a network stream).
That doesn't seem like a good example. The data arriving over the network arrives length-prefixed, because 0 is a legal byte value for arbitrary data. What do you then gain by throwing away your existing knowledge of the length?