Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!floyd!cmcl2!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.unix-wizards Subject: Re: getc() != EOF Message-ID: <7301@umcp-cs.UUCP> Date: Thu, 31-May-84 02:14:28 EDT Article-I.D.: umcp-cs.7301 Posted: Thu May 31 02:14:28 1984 Date-Received: Sat, 2-Jun-84 09:48:53 EDT References: <30@utastro.UUCP> <307@basser.SUN> Organization: Univ. of Maryland, Computer Science Dept. Lines: 20 I beg to differ. K&R, p. 40: ``There is one subtle point about the conversion of characters to integers. The language does not specify whether variables of type {\tt char} are signed or unsigned quantities. When a {\tt char} is converted to an {\tt int}, can it ever produce a {\it negative} integer? Unfortunately, this varies from machine to machine, reflecting differences in architecture. One some machines ({\csc pdp-11}, for instance), a {\tt char} whose leftmost bit is 1 will be converted to a negative integer (``sign extension''). On others, a {\tt char} is promoted to an {\tt int} by adding zeros at the left end, and thus is always positive.'' (Now if you state that all {\it civlized} compilers default to signed characters and allow {\tt unsigned char} datatypes, I will agree.) -- In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690 UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland