G
Guest
Hello,
I want to iterate the second dimension of a 2-dim-array.
Let´s say I have an array:
double[,] myArray and a given index: int i.
Assume my index is given in want to iterate my array with something like
this:
int i = 2;
double sum= 0.0;
for(int j = 0; j < myArray.Length; j++)
sum += myArray[i,j];
But this does not work, because I am using the 2dim-array as 1dim-array.
My problem is... how do i get the size of the second dimension?
Regards,
Martin
I want to iterate the second dimension of a 2-dim-array.
Let´s say I have an array:
double[,] myArray and a given index: int i.
Assume my index is given in want to iterate my array with something like
this:
int i = 2;
double sum= 0.0;
for(int j = 0; j < myArray.Length; j++)
sum += myArray[i,j];
But this does not work, because I am using the 2dim-array as 1dim-array.
My problem is... how do i get the size of the second dimension?
Regards,
Martin