Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!umcp-cs!aplcen!jhunix!ecf_eprm From: ecf_eprm@jhunix.UUCP (Paul R Markowitz) Newsgroups: net.lang.c Subject: Int and Char Message-ID: <3250@jhunix.UUCP> Date: Thu, 24-Jul-86 09:31:56 EDT Article-I.D.: jhunix.3250 Posted: Thu Jul 24 09:31:56 1986 Date-Received: Fri, 25-Jul-86 06:32:57 EDT Reply-To: ecf_eprm@jhunix.UUCP (Paul R Markowitz) Organization: Johns Hopkins Univ. Computing Ctr. Lines: 33 Don't C programmers know the difference between a char and an int? I get these great public domain programs off the net and I spend the next 2 weeks deciding which variables are declared as char but really mean short. You see, it's like this. Short, int, and long are all SIGNED. That means they can take on negative values. Chars are NOT SIGNED, there is no char called -1. If you want a variable that takes on negative values, use a short. It certainly makes your code easier for others to read as well as making it more portable. For my next question, why doesn't my C compiler accept declarations like 'signed char a;' or something like that? It says 'signed undefined' and dies. Is there no way to make up for the errors of others and artificially make chars come out signed? I am running sys V rel2 on an att 3b20. Just had to get this off my chest. Paul -- ------------------------------------------------------------------------ Paul Markowitz "A pessimist is someone who won't call on G-d because he is certain he will get an answering machine." "Do you wonder if I'm really happy? seismo!umcp-cs!jhunix!ins_aprm Am I just the company you keep? bitnet: ins_aprm@jhuvms Which one of us excercises on the old arpanet: ins_aprm%jhunix.BITNET@wiscvm.ARPA tread mill? Who hides his head pretending to sleep?" -Ian Anderson (and Robert Burns?)