[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: char vs. unsigned char
From: |
Riccardo Mottola |
Subject: |
Re: char vs. unsigned char |
Date: |
Fri, 13 Mar 2015 15:00:37 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33 |
Hi,
thanks guys.
Stefan Bidigaray wrote:
As was already mentioned, I think it should be thought as:
char = characters
Unsigned char = unsigned integer less 256 or data
Signed char = signed integer between -128 to 127
That's about what I thought. Signed char is essentially useless, if not
for representing small integers.
But for Data, signedness shouldn't matter, right? it is meaningless. So
I could have everything as char * and "cast" when appropriately needed
(like the example Wolfgang found, where a char is effectively
interpreted as a small number). Or keep everything as unsigned char and
cast to functions which do not need it.
I somehow like the former, because if for data a signedness is "don't
care" I can leave it to the platforms, but you seem to suggest that
specifying it always except for the functions defined not to need it is
perhaps less error prone.
For sure the patch is not correct, I'll look at it again, thanks.
Riccardo
- char vs. unsigned char, Riccardo Mottola, 2015/03/12
- Re: char vs. unsigned char, Luboš Doležel, 2015/03/12
- Re: char vs. unsigned char, David Chisnall, 2015/03/13
- Re: char vs. unsigned char, Richard Frith-Macdonald, 2015/03/13
- Re: char vs. unsigned char, Wolfgang Lux, 2015/03/13
- Re: char vs. unsigned char, Sebastian Reitenbach, 2015/03/13