Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!oberon!sm.unisys.com!csun!srhqla!tcm From: tcm@srhqla.UUCP (Tim Meighan) Newsgroups: comp.lang.modula2 Subject: Re: "for" loops (was Re: C++ vs. Modula2) Message-ID: <391@srhqla.UUCP> Date: 31 Jan 89 17:32:15 GMT References: <19579@agate.BERKELEY.EDU> <8515@lanl.gov> <6419@polya.Stanford.EDU> Reply-To: tcm@srhqla.UUCP (Tim Meighan) Organization: Silent Radio, Los Angeles Lines: 16 In article <6419@polya.Stanford.EDU> crew@Polya.Stanford. EDU (Roger Crew) writes: >Hint: the answer is *not* > char a, b, c; > for (c = a; c <= b; ++c) { ... } >(just try a = 0 and b = 255 in the case of 8 bit chars). Sure it is. You need to declare a, b, and c as: unsigned char a, b, c; Otherwise, setting b = 255 is actually doing this: b = -128. Tim Meighan Network Operations Silent Radio