Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!iuvax!pur-ee!mendozag From: mendozag@pur-ee.UUCP (Grado) Newsgroups: comp.lang.c Subject: Why unsigned chars not default? Message-ID: <9563@pur-ee.UUCP> Date: 21 Oct 88 07:08:15 GMT Reply-To: mendozag@ee.ecn.purdue.edu (Victor M Grado) Distribution: na Organization: Purdue University Engineering Computer Network Lines: 22 A guy around here is trying to port to several machines a program he hacked away in a PC using Lattice C. For some obscure reason in his original program he decided to use only low-level I/O. That forced him to "split" integers and then save them as 2 bytes and then later when the file is read back the integers are put together(!). However, much to his dismay, other compilers (LSC, MSC, and Unix) require him to declare as unsigned char the I/O buffer (which he also uses for arithmetic operations) else the chars are negative numbers when the their contents represents value > 127. (He does a lot of arithmetic with characters representing integers). He claims the compilers are at fault and that all the compilers should have 'unsigned char' as default for characters so you can do all sorts of arithmetic with them. Any comments and/or suggestions I can pass along? [He basically learned C while developing this program and now has the chance of porting it to other machines, with copyright and all!]. mendozag@ecn.purdue.edu