Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c Subject: Re: Comparing chars to constants Message-ID: <2515@mmintl.UUCP> Date: Thu, 22-Oct-87 19:32:36 EST Article-I.D.: mmintl.2515 Posted: Thu Oct 22 19:32:36 1987 Date-Received: Mon, 26-Oct-87 05:49:48 EST References: <4663@elroy.Jpl.Nasa.Gov> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT. Lines: 19 In article <4663@elroy.Jpl.Nasa.Gov> david@elroy.Jpl.Nasa.Gov (David Robinson) writes: > if (p == 0x80) As several people have noted, this is indeed not portable. I agree that the best way to write this is: if (p == '\200') or whatever the ANSI syntax is for hex constants in strings/characters. I will note that one other way to write this, with the new ANSI standard, would be: if (p == 0x80u) This will coerce p to unsigned. -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108