CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Correct syntax(es) for escape sequences in strings

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

Correct syntax(es) for escape sequences in strings
PostPosted: Fri Dec 17, 2004 1:37 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 17, 2004 1:57 pm     Reply with quote

The MSDN C Language Reference only shows Octal and Hex
are supported, but not decimal. So CCS is following the spec on this.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/eleme_15.asp
object01



Joined: 13 May 2004
Posts: 90
Location: Nashville, TN

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Dec 17, 2004 2:10 pm     Reply with quote

PCM programmer wrote:
The MSDN C Language Reference only shows Octal and Hex
are supported, but not decimal. So CCS is following the spec on this.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/eleme_15.asp


??? 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

View user's profile Send private message

PostPosted: Fri Dec 17, 2004 2:14 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group