Difficulty copying multi dimensional static array to dynamic array.

Saaa empty at needmail.com
Mon Feb 25 14:11:11 PST 2008


Using ref should do the trick without pointers.

>
>> All I am trying to do is 'return' an array so that toFloatArray4x4() can
>> be called to fill in a static array.
>
> Because for some mysterious reason, one can't pass the static array by
> reference you probably need to do it the old fashioned way ...
>
> void fillArray(float *d, int len)
> {
>   while (len > 0)
>   {
>     *data = somevalue;
>      data++;
>      len--;
>   }
> }
>
> float[4][4] m1;
> fillArrary( &m1[0][0], 4 * 4 );
>
> -- 
> Derek Parnell
> Melbourne, Australia
> skype: derek.j.parnell 




More information about the Digitalmars-d-learn mailing list