K
Keith Thompson
jacob navia said:Bartc said:OK so you use a length *and* a zero-terminated string? [...]I pass what it expects obviously. In my implementation,
I always append a zero to the string stored so the conversion
is very fast.
Makes sense (that's what I do). But then you lose one advantage of
length+string which is dealing with arbitrary binary data, which can
include zeros.
Is only the zero at String.length that counts. Embedded zeroes inside
the string are NOT significant.
When you say they're not significant, do you mean that they're taken
as part of the string? For example, if the length field is 3 and the
character array contains { 'x', '\0', 'y', '\0' }, does that denote a
"string" of length 3 containing an 'x', a null character, and a 'y'?
I ask because saying that they're not significant could imply that
they're ignored.