#Ansi Codes from 'C'
02-Sep-90 18:43:36
Sb: #118764-#Ansi Codes from 'C'
Fm: Mike Spille/Manx 71545,1466
To: John Draper 76703,4322
Sorry, a char is 8 bits, and an unsigned char is also 8 bits. The range of
the two is difference, but they have the same number of bits. And C
compilers will put in the unsigned bit pattern, even if it don't fit the
range i.e.
char c;
c = 255;
will put the bit pattern 1111 1111 into c, even though that's -1. The
reason the compiler is flagging it is that ANSI states that hex character
constants continue from the 'x' to the first non-hexadeciaml chracter.
Since 9b0 is greater than a character, in size, the compiler spits out a
warning message.
The way to split things up is to either use string concatenation, or to
make sure the hex constant isn't followed by something which could be
interpreted as a hexadecimal character.
-Mike