What does \x00 mean in binary file?

后端 未结 2 1731
闹比i
闹比i 2021-02-03 22:41

Once I asked a guy \"what is the difference between ASCII and Binary files?\"

And he said \"Binary files always have \\x00\"

I\'ve been searching about this and

2条回答
  •  执笔经年
    2021-02-03 23:10

    An ASCII file might be read or interpreted as having NULL-terminated strings, carriage returns & line-feeds, or other control characters, that are intended to be read and acted on. For example, a text reader might look for a line of text, where a line is "however many characters you see before you get to a linefeed"

    A binary file is considered to be just a sequence of bytes - none of them has any special meaning, in the sens that a text-reader would interpret them.

    \x00 is an example of a specific byte value (HEX 0), that might be interpreted in a special way by a text reader.

提交回复
热议问题