> >
> > int main ()
> > { const dim = 5;
> > float a[dim-1][dim-1];
>
> The above creates a matrix of [4][4]; that is, each dimension varies from
> [0] to [3]. a[0][3] is the last element of the first row; a[0][4] is
> infact the first element of the second row which is better represented by
> a[1][0].
Are we allowed to assume that row-major order arrays are totally
contiguous in memory for any platform (by your example of address
a[0][4])? For arrays of structures or objects (or some other big unit),
is it not possible for their locations in memory to be non-contiguous?
Also i'm assuming that you cannot access a[0][4] directly because wouldn't
that cause an out-of-bound subscript error? So you would instead do some
manual pointer arithmetic to get that address, right?
Thanx for any response.
Best Regards,
<*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*>
<*> Dan Jue, CMSC UMCP <*> Linux '99 <*>
<*> <*> ReSiTaNcE iS FuTiLe! <*>
<*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*><*>