Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!stealth.acf.nyu.edu!brnstnd From: brnstnd@stealth.acf.nyu.edu Newsgroups: comp.std.c Subject: a[], *p: if 0 <= p - a < sizeof(a), must p point to an element of a? Message-ID: <875@stealth.acf.nyu.edu> Date: 4 Jan 90 18:39:53 GMT Sender: brnstnd@stealth.acf.nyu.edu Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 8 Basically, I want to have a guaranteed test of whether p points to an element of a, with foo a[N] and foo *p. I know that *if* p points to an element of a, *then* 0 <= p - a < sizeof(a); is the reverse true? (If yes, please explain the logic.) The standard should define pointer subtraction more carefully. ---Dan