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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public From: rgs20@cam.ac.uk (Richard Stamp) Subject: Re: How big is an int? Date: 1997/11/04 Message-ID: <63nids$vu$1@lyra.csx.cam.ac.uk>#1/1 X-Deja-AN: 287890820 References: <34557f2b.1934172@news.mindspring.com> <63anc7$75p$1@darla.visi.com> <345947D2.D20EF8E9@horvath.com> <345F49A2.5F5DC5A0@aom.ericsson.se> Followup-To: comp.lang.c Organization: University of Cambridge, England Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy Date: 1997-11-04T00:00:00+00:00 List-Id: In article <345F49A2.5F5DC5A0@aom.ericsson.se>, Ted Lyngmo wrote: > >short = 2 bytes >long = 4 bytes These are the effective _minimum_ lengths (though in fact, the size is defined in terms of a minimum range of values to be held) but individual compilers are free to exceed them if they wish. >int = 2 or 4 bytes Right idea, but an int doesn't have to be the same as a short or a long; it can be anywhere in between. >If this is true, I see no reason for ever using ints in new C programs. ints are supposed to have the natural size for the architecture, so should be fast to work with: this makes them good choices for things like loop counters. Cheers, Richard -- Richard Stamp Churchill College, Cambridge