Backslash zero delimiter '\0'

后端 未结 3 682
余生分开走
余生分开走 2021-02-05 05:20

I have seen \'\\0\' to be used as a delimiter in mixed binary files (UTF8 strings + binary data). Could anyone explain what \'\\0\' means or point to a

3条回答
  •  天涯浪人
    2021-02-05 05:47

    \0 is shorthand for \000 which is an octal character escape. In general, you can shorten any octal escape that isn't followed by an octal digit. This derives from the original C escape sequences (\n \r \t \f \v \b \000 where the latter is a character value in octal notation; ANSI added some, and \v is somewhat rare these days and many more modern languages don't implement it).

提交回复
热议问题