> erik quanstrom wrote: > >> The point is how to compute the offset(s) of the last field at compile / > >> run time. > >> > > > > the offset of the last field is not in question. i believe you mean the > > size? > > > It's really the same info.
it is not. the size and offset are different things. > offset(B) = 100, &(A.B[7]) == address(A) + 100 + 7*sizeof(int). > The compiler accept the dirty but legal expression A.B[-3] because it > can compute > the address (or the offset with respect the beginnig of "A") of the B > "-3" cell. this is completely beside the point and furthermore the sizeof A.B never enters into the picture. - erik