How could I include a unit separator (value 31 in ascii table) in a string other than using snprintf()
? I want to do like we normally initialize a string.
eg
char[100] a = "abc"
31 in dec = 0x1f in hex. Therefore,
char x[] = "blah\x1f" "blah";
// ^^^^ unit separator.
The string is split into two to avoid the compiler reading the escape sequence as 0x1fb (it should be read as 0x1f, which is 31 in decimal). Alternatively you could use octal sequence:
char x[] = "blah\037blah";
// ^^^^ unit separator.
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