3 ms·
Most systems aren't generally memory-starved enough that you can't spare the constant number of bytes for keeping track of string lengths. That's the sort of t
by userbinator 6y ago
Most systems aren't generally memory-starved enough that you can't spare the constant number of bytes for keeping track of string lengths.
That's the sort of thinking that gave us instant messaging applications which take gigabytes of memory and can saturate several year-old CPU cores trying to render some text...
That said, null termination + length is usually a good string representation. Instant length retrieval with the ability to ignore it when your algorithm needs to read to the end anyway.