Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!psuvax1!psuvm!psuecl!c9h From: c9h@psuecl.bitnet Newsgroups: comp.lang.c Subject: Re: Pointer arithmetic and comparisons. Message-ID: <70817@psuecl.bitnet> Date: 8 Dec 89 01:36:25 GMT References: <257ECDFD.CDD@marob.masa.com> Organization: Engineering Computer Lab, Pennsylvania State University Lines: 17 In article <257ECDFD.CDD@marob.masa.com>, daveh@marob.masa.com (Dave Hammond) writes: > The problem occurs when the address resulting from &buffer[len] exceeds > 65535. For example, if &buffer[0] is 65535 and len is 100, &buffer[len] > becomes 99, making `while (p < e)' immediately false. > > I was under the impression that (for n > 0) buffer[n] should not yield > an address lower than buffer[0]. Is the pointer comparison I am doing > non-portable, or otherwise ill-advised ? This will *only* occur if you are accessing an element outside of the array's boundaries. -- - Charles Martin Hannum II "Klein bottle for sale ... inquire within." (That's Charles to you!) "To life immortal!" c9h@psuecl.{bitnet,psu.edu} "No noozzzz izzz netzzzsnoozzzzz..." cmh117@psuvm.{bitnet,psu.edu} "Mem'ry, all alone in the moonlight ..."