Can a string constant like "foo" "\x01" "bar"
be written as a single string literal (while keeping the hexadecimal notation)? With "foo\x01bar"
the escape sequence seems to be interpreted as \x01ba
since I get the warning "hex escape sequence out of range."
"foo" "\x01" "bar"
is a string literal.
The C standard states that a hexadecimal escape sequence is the longest sequence of characters that can constitute the escape sequence. Without the explicit concatenation (which is the common workaround to this problem), the compiler parses \x01ba
which is obviously out of range.
How about "foo\x01\142ar"
? Is that cheating?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With