Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!jade!ucbcad!ames!hao!oddjob!mimsy!cvl!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Sizes and types (was: 32bit = 16bit x 16bit) Message-ID: <6610@brl-smoke.ARPA> Date: Thu, 29-Oct-87 23:44:56 EST Article-I.D.: brl-smok.6610 Posted: Thu Oct 29 23:44:56 1987 Date-Received: Wed, 4-Nov-87 05:36:01 EST References: <1912@gryphon.CTS.COM> <3294@sol.ARPA> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <5657@jade.BERKELEY.EDU> mwm@eris.BERKELEY.EDU (Mike (My watch has windows) Meyer) writes: >1) Never use "char" to hold something being used as an integer. You >have no idea how big it may be on some other machine. You know it's at least 8 bits. A more serious problem is that a plain "char" may be signed or unsigned, depending on the implementation, so if more than the range 0..127 is needed, portability suffers. If one has a modern C compiler, explicit "signed char" or "unsigned char" can be specified, but not all compilers support that yet.