Pointer arithmetic and comparisons.

Shane Dawalt sdawalt at wright.EDU
Sun Dec 10 07:00:40 AEST 1989


in article <257ECDFD.CDD at marob.masa.com>, daveh at marob.masa.com (Dave Hammond) says:
> 
> 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.
> 

  That same problem also haunted me: Could a block be allocated such that the
block was split in two by the segment boundry?  I was inclined to believe
not.  I was correct for once.  The question was asked in the Compuserve
Borland forum (BPROGB).  Both Borland techs and forum members assured me this
cannot happen unless I attempt to access outside of the allocated block.

  Shane    sdawalt at cs.wright.edu



More information about the Comp.lang.c mailing list