|
From: Earnie B. <ear...@ya...> - 2001-04-09 15:39:55
|
Joerg Bruehe wrote: > > Hi ! > > Lloyd Dupont wrote: > > > > ok, if i well understand char, short, long have a size independant > > of thet processor > > whire are, respectively, 1, 2, 4. > > and int is the size of a register. 4 on 486 machine an even 8 on a > > 64 bits machine (so sinzeof(int) > sizeof(long) for such a machine) > > I do not know the exact location(s) in the C standard(s), > but I am quite sure this is wrong: > > On byte-addressable machines, "char" is 1 byte. > (AFAIK, it is even defined that on _all_ machines > sizeof ( char ) == 1 .) > What is your definition of BYTE? AIUI, the standard (which I don't have a reference to either) guarantees that `sizeof(char) == 1' but doesn't guarantee that `sizeof(char) == 8bits'. AIUI, the standard says short <= int <= long <= long long <= next generation bit pattern. Given this the bit length of short, int, long, long long, ... could all be the same length. IMO, it would be beneficial for the standard to change to using int8, int16, int32, etc. so that it was obvious as to what is meant; but, that isn't likely to happen anytime soon. Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |