3 ms·
That sounds like an unambiguous no to me (null-terminator not included in count.)
by zeroxfe 12y ago
That sounds like an unambiguous no to me (null-terminator not included in count.)
- robert_tweed 12y agoI believe you are correct, mainly because the basic purpose of the protocol is "no parsing", so therefore it must work when loaded directly into RAM. The spec is a bit confusing though, because of the statement that "Strings are simply a vector of bytes". The way I understand it is that a string is a vector FOLLOWED BY a null terminator. The spec should probably say that rather than the current wording. This would appear to be necessary so that a string can be treated as either a vector like any other (with the correct number of elements) and can also be accessed directly by a (char *) pointer without things going awry. Disclaimer: I haven't read the whole spec yet; this is my off-the-top-of-my-head interpretation and I may have misunderstood it completely.
- mockery 12y agoI'd expect that strings are just a vector of bytes, with strlen()+1 bytes, the last of which is always null.