Bounds checks. (was variable-length struct hack)
T. William Wells
bill at twwells.com
Wed Dec 13 06:03:47 AEST 1989
In article <1989Dec11.181631.3864 at jarvis.csri.toronto.edu> norvell at csri.toronto.edu (Theo Norvell) writes:
: int A[N], *p;
: for(p=A; p < A+N ; ++p ) { ... } /* Good */
: for(p=A; p < &A[N] ; ++p ) { ... } /* Undefined! */
The two are exactly the same:
&A[N] = &(*(A + N)) = A + N
---
Bill { uunet | novavax | ankh | sunvice } !twwells!bill
bill at twwells.com
More information about the Comp.std.c
mailing list