I am trying to create a string with characters outside the ASCII printable range. I am using an STM32 microcontroller using the µVision IDE with the Keil compiler. The documentation allows various escape sequences, including one for "ASCII code in hexadecimal." When I just want one character there is no problem, but if I want to put other numbers in the same string after the character, I start getting issues.
char myString = "\x06";//(It gives me 0x06,0x00,...,0x00)
This doesn't. (It gives me 0x60
char myString = "\x060";//(It gives me 0x60,0x00,...,0x00)
The more characters (0-F) in the same continuity that keep getting appended as hexadecimal digits of the same number (it will even throw a warning that it is out of range if the number gets too big). Is there some way around this? Might this be a compiler issue?