<div dir="ltr"><div dir="ltr"><div>Apropos of the virtue of negative subscripts.</div><div><br></div><div>> by pointing into the middle of another data structure you've created a data aliasing situation</div><div><br></div><div>Not if all references are relative to the offset pointer. The following example is silly,  but I recently used exactly this trick to simplify calculations on a first-quadrant (x,y) grid by supplying "out-of-bounds" zeroes at (x,-2), (x,-1) and (-1,y). It was much cleaner to access the zeroes like ordinary elements than to provide special code to handle the boundary conditions.</div><div><br></div><div>/* Fill an N-element array with Fibonacci numbers, f(i), where 0<=i<N. </div><div>   The recursion accesses a zero "out of bounds" at i=-1 */</div><div><br></div><div>const int N = 100;</div><div><br></div><div>int base[N+1];</div><div>#define fib(i) base[(i)+1]</div><div><br></div><div>void fill() {</div><div>    int i;</div><div>    fib(0) = 1;</div><div>    for(i=1; i<N; i++)</div><div>        fib(i) = fib(i-2) + fib(i-1);</div><div>}</div><div><br></div><div>Doug</div><div><br></div><div><br></div></div></div>