|
From: <dan...@ya...> - 2001-04-10 01:25:07
|
--- Earnie Boyd <ear...@ya...> wrote: > 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. > Have a look in stdint.h, which is part of C99 standard. Danny _____________________________________________________________________________ http://movies.yahoo.com.au - Yahoo! Movies - Now showing: Dude Where's My Car, The Wedding Planner, Traffic.. |