Hi,
If Im using Jagged arrays, the following is possible:
int[][] arr = new int[10]
for(int i=0; i<10; i++) {
arr = new int[10];
}
int[] arrB = arr[3];
How can I achieve the same thing (i.e. create a single dimensional array
by assigning a copy of some row of a multidimensional array to it) using
multidimensional arrays? Also, in the last line above, a row is not
being assigned or copied by value right? A copy of the reference to the
4th row is being assigned to arrB? Thanks!
Oh and I dont want to use a For loop.. I mean, I don't want to do the
following:
int[] arrB = new int[arr.GetLength(0)];
for(int i=0; i<10; i++) {
arrB = arr[4, i];
}
Thanks
-Phil
If Im using Jagged arrays, the following is possible:
int[][] arr = new int[10]
for(int i=0; i<10; i++) {
arr = new int[10];
}
int[] arrB = arr[3];
How can I achieve the same thing (i.e. create a single dimensional array
by assigning a copy of some row of a multidimensional array to it) using
multidimensional arrays? Also, in the last line above, a row is not
being assigned or copied by value right? A copy of the reference to the
4th row is being assigned to arrB? Thanks!
Oh and I dont want to use a For loop.. I mean, I don't want to do the
following:
int[] arrB = new int[arr.GetLength(0)];
for(int i=0; i<10; i++) {
arrB = arr[4, i];
}
Thanks
-Phil