3 ms·
> if it is an octal escape it’s four; I just figured out that 1. `\0` and octal numbers share the same prefix 2. Octal numbers can have 1-3 digits (not fixed
by chrishill89 3y ago
> if it is an octal escape it’s four;
I just figured out that
1. `\0` and octal numbers share the same prefix
2. Octal numbers can have 1-3 digits (not fixed)
So maybe it’s more tricky than I thought.
- _kst_ 3y agoAn octal-escape-sequence is a backslash followed by 1, 2, or 3 octal digits. '\0' is just another octal escape sequence, not a special-case syntax for the null character. "\0", "\00", and "\000" all represent the same value; "\0000" is a string literal containing a null character followed by the digit '0'. Hexadecimal escape sequences can be arbitrarily long. If you need a string containing character 0x12 followed by the digit '3', you can write "\x12" "3".
- chrishill89 3y agoThanks, that makes sense. :)