March 06, 2004
got it :o))

Thanks for explaining.

Phill.



"Ilya Minkov" <minkov@cs.tum.edu> wrote in message news:c2dm8p$1o1u$1@digitaldaemon.com...
> When you cast one array type into another, the array data is not being converted, only the index is. Thus an int[10] casts into byte[40]. But these are not the same values, it's just "bit noise" from ints. Converting the whole array would be an expensive operation involving an allocation and a loop over all aray elements.
>
> -eye
>
> Phill schrieb:
>
> > I do understand everything that you say and have all along.
> >
> > I just think  that .length is supposed to reffer to the amount of
indexes in
> > the array, if it does then why
> > am I getting this error?
> > error: lengths dont match for array copy
> > when I run this code:
> >
> > int[10]  aray;
> > byte[10] bray =  cast(byte[])aray;
> > printf("aray.length =%d ", aray.length);
> > printf("bray.length = %d ", bray.length);
> >
> > Is it because the size of the data in each index
> > is larger?
> >
> > Phill
> >


1 2 3
Next ›   Last »