From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public From: nospam@spam.com Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/05 Message-ID: #1/1 X-Deja-AN: 287239559 References: <34557f2b.1934172@news.mindspring.com> <63anc7$75p$1@darla.visi.com> <345947D2.D20EF8E9@horvath.com> <345F49A2.5F5DC5A0@aom.ericsson.se> <63oadj$ljc$1@helios.crest.nt.com> Organization: Chemical Abstracts Service Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.c,comp.lang.c++ Date: 1997-11-05T00:00:00+00:00 List-Id: kaz@helios.crest.nt.com (Kaz Kylheku) writes: > > In article <345F49A2.5F5DC5A0@aom.ericsson.se>, > Ted Lyngmo wrote: > >Bob Horvath wrote: > >> > >> Hmmmm. How big is an int? > > > >As I've understood it, an int has two legal sizes. A short has only one, > > You haven't understood it. > > A short is large enough to represent numbers in the range -32767 to > 32767. An int is also large enough to represent numbers in the > same range. A long can represent numbers in the range -2147483647 > to +2147483647. Nor have you. The definitions are as follows. short <= int <= long short < long short > char If your system does not conform to this, it isn't ISO (I thinhk it was ISO) compliant. What you stated above is true for (I would assume) all 32bit systems. It will not necessarily hold for 64 bit or 128 bit systems. I even had one person in the past try and tell me that when Intel went to 64bits, that M$ was going to have: short = 2 bytes long = 4 bytes int = 8 bytes /Mike