in reply to Re: Re: what does goto ""; mean?
in thread what does goto ""; mean?

Careful. They're treated the same in C, but they're not. The difference between "" and "\x00" is that the former is one byte long, whose value is null, while the latter is two bytes long - two nulls. But since everything in C treats a null as end-of-string, the difference is not apparent anywhere.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^2: what does goto ""; mean?
by pg (Canon) on Dec 11, 2003 at 19:21 UTC

    This is the synergy of a cyber-team. We are together adding blocks to build our tower.

    Obviously I agree with you. The actually memory setting of “” and “\x00” are different, but the interpretation (when it is exposed to programmers as string) in c is the same. We can actually see two layers:

    • The actual data storage in memory
    • The interpretation offered by the language
      The interpretation offered by the language
      To be pedantic - that's not quite right either. The C language doesn't know anything about NUL terminated strings. It's the C library (and the str...() functions in particular) that use this convention.

      Michael (OK, I'll stop splitting hairs now :-)

Re: what does goto ""; mean?
by Abigail-II (Bishop) on Dec 12, 2003 at 01:59 UTC
    The difference between "" and "\x00" is that the former is one byte long, whose value is null, while the latter is two bytes long - two nulls.
    The character '\0' is the NUL (single L) character. NULL (double L) is a pointer, not a character.

    Abigail