Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: bits in an int vs. long? Message-ID: <866@crdos1.crd.ge.COM> Date: 6 Oct 89 15:38:50 GMT References: <181@inpnms.UUCP> <252BB03A.2AEC@drivax.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Distribution: na Organization: GE Corp R&D Center Lines: 23 In article <252BB03A.2AEC@drivax.UUCP>, frotz@drivax.UUCP (Frotz) writes: | It is my understanding that: | | sizeof(char) < sizeof(short) < sizeof(long) | sizeof(short) == 2 | sizeof(long) == 4 Actually sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long) All of the sizeof are defined as being a minimum number of bits, or the equivalent range I don't remember. I suspect that char could be the same size as short if someone made a char large enough (16 bits min). This from the bible according to St ANSI ;-) In some machines the sizeof short, int, and long are identical. Extrapolate to unsigned everything and float/double, too. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon