Re: Null-terminated strings: the final analysis.



Joe Wright <joewwright@xxxxxxxxxxx> writes:

I believe strings can contain tabs, and other things that don't print but I
agree strings cannot contain the NUL character.

.... by a trivial consequence of C's definition of a string, no less.

Further, a text file is corrupted by the NUL character in a line.

Only because C strings can't represent lines of text containing a zero
byte. Using this to justify C's representative inadequacy is circular.

-- [mdw]
.



Relevant Pages

  • Re: ends_with() ?
    ... Joe Wright wrote: ... >> does anybody know about a standardfunction or a simpler way ... > There is no point to the actual memcmp(). ... but the strings may be equal even though the addresses aren't. ...
    (comp.lang.c)
  • Re: dh, the daemon helper
    ... EBCDIC NUL-terminated strings don't suffer from such inefficiency? ... EBCDIC has a NUL character. ... That char at a time iteration can be costly, ... some implementations require padding bytes to work with larger types than ...
    (comp.unix.programmer)
  • Re: Null-terminated strings: the final analysis.
    ... Mark Wooding writes: ... by a trivial consequence of C's definition of a string, ... Only because C strings can't represent lines of text containing a zero ...
    (comp.lang.c)
  • Re: Null-terminated strings: the final analysis.
    ... snip ... ... strings, which is that they can't represent strings containing ... what possible use can you have for a zero byte? ... I believe strings can contain tabs, and other things that don't print but I agree strings cannot contain the NUL character. ...
    (comp.lang.c)