View previous topic :: View next topic |
Author |
Message |
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
Correct syntax(es) for escape sequences in strings |
Posted: Fri Dec 17, 2004 1:37 pm |
|
|
What forms of escape sequences does CCS accept in strings? I've got an LCD display (standard, probably) that has a special right-arrow character at character map address 0b01111110. Of the following,
"Here's an arrow: \126"
"Here's an arrow: \x7E"
"Here's an arrow: \b01111110"
Only the hex representation works. The binary literal won't compile, and \126 prints 'V' on the display, which is at map address 0b01010110 for this LCD. How do \126 and 0b01010110 relate?
I've used \255 in string literals before as a recognizable terminator that helps me write functions that I can pass string constants to. So I expected \126 to work. If \255 is compiled correctly, why doesn't \126 seem to be?
--
Jeff S. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
|
Posted: Fri Dec 17, 2004 2:10 pm |
|
|
??? Did I miss something? CCS builds their compiler according to the MSDN C Reference?
Wow.
--
Jeff S. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Dec 17, 2004 2:14 pm |
|
|
No, but your complaint appeared to be as if you were used to
using a "real compiler". So I picked the MSDN documentation
to show that CCS wasn't doing anything wrong by not supporting
decimal escape sequences. |
|
|
|