| re: Problem with arrays
You're going to have to copy them in a loop. I threw together this function
which should make it a simple task.
public void CopyToArray(double[] sourceArray, double[,] destinationArray,
int destinationArrayIndex)
{
Debug.Assert(sourceArray.Length == destinationArray.GetLength(1)); //
make sure the to/from arrays are the same length
for (int i=0; i<sourceArray.Length; i++)
{
destinationArray[destinationArrayIndex, i] = sourceArray[i];
}
}
And in your case, you would call it like this:
CopyToArray(myMethod1(), myArray, 0);
ShaneB
"Xarky" <bernardpace@yahoo.com> wrote in message
news:bc42e1a.0411061111.4658017e@posting.google.co m...[color=blue]
> Hi,
> I have a two dimensional array as follows:
>
> double[,] myArray = new double[14, 41];
>
> Now I have a method which is returning double[], which is of size 41.
>
> I need to put the data of the array returned into myArray.
>
>
> myArray[0, ???] = myMethod1(); // return double[41]
> myArray[1, ???] = myMethod2(); // return double[41]
> etc
>
> I hope someone understands my problem and can help me out.
>
>
> Thanks in Advance[/color] |