Hello,
I cannot compile this:
unsigned char myChars[]= "?|\+*";
The compiler (CW8.3) complanis about illegar character constant. OK I understand
this. So I changed it to:
unsigned char myChars[]= "?|\\+*";
thinking that \\ will be changed to \
but after preprocessing I see that there are two \\ in the myChars array. I want
one!
Can anyone give me a clue how to place a backslash into the string?
TIA,
Michau
David Phillip Oster - 28 Aug 2003 15:36 GMT
> unsigned char myChars[]= "?|\\+*";
> thinking that \\ will be changed to \
> but after preprocessing I see that there are two \\ in the myChars array. I
> want one!
You are right, it is just that the tool you are using to look at the
string is drawing the backslash doubled. to see this, look at
myChars[3]. It should be '+'.
Miro Jurisic - 28 Aug 2003 17:42 GMT
> I cannot compile this:
> unsigned char myChars[]= "?|\+*";
> The compiler (CW8.3) complanis about illegar character constant. OK I
> understand this.
You can? I can't. What you have above should compile just fine, and it does.
meeroh

Signature
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>