Basically, this string constant is declared in rom:
byte const foobar[10] = {"\1hi there!"};
1st character is binary value 1, because i use the escape sequence to get it in. That's what i want.
Now i need to add the digit 1 after it in the string, or hex value 31
If I do this:
byte const foobar[10] = {"\11hi there"};
I'm doomed! Ascii value 11 goes there instead.
So basically I could do this:
byte const foobar[10] = {"\1\x31hi there"};
But that sure is ugly. Especially to the person who's going to read that and make sense of it when translating or something.
Any ways to stop the escaping to stop escaping? Or maybe i'm just not seeing clear today.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue May 16, 2006 1:57 pm
Use the full 3 digits of the octal sequence (i.e., \001). Then it works.
Example:
Code:
byte const foobar[12] = {"\0011Hi There!"};
Also note that the array must be 12 bytes in size -- 11 bytes for the
characters and one more for the string terminator.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum