comp.std.c

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Aug 31 10:27:58 AEST 1989


In article <426 at maytag.waterloo.edu> lhf at aries5 (Luiz H. deFigueiredo) writes:
>Now I ask, it is possible/legal to do the analogous thing for a-1 as in
>	char *head=a-1;		/* Here! */

The Standard does not guarantee that this will work, although it might work
uner some circumstances under some implementations.

The asymmetry between last+1 (guaranteed) and first-1 (not guaranteed) is
due to the former only requiring one byte safety allowance while the latter
requires an entire array member amount of safety allowance.  It was
considered sufficient to guarantee just one way of traversing an array,
and the readily implementable choice was made.



More information about the Comp.lang.c mailing list