public static void processSingleArray(int[] arr) {
I can do this fine:
int[] Array1 = { 3, 4, 5 };
processSinglleArray(Array1);
But now, suppose I wanted to run this method with a row or column of a multidimensional array. I've always thought of multidimensional arrays as arrays of arrays, so it seems I could do something like this:
int[,] Array2 = { {2, 3}, {3, 23} };
processSingleArray(Array2[ 1, ]; // intent is to process on the column of index 1.
processSingleArray(Array2[ , 0 ]; // intent is to process on the row of index 2.
or, maybe:
processSingleArray(Array2.ItemsAtColumn(1));
processSingleArray(Array2.ItemsAtRow(0));
and obviously, neither of these are compiling. I'm not sure of the syntax to pass the items at a specified index in the way I'd like. I know I could write code to cycle through each row and column in the 2d array, but i'd like this to work on arrays of even more dimensions too, without duplicating code effort. I don't think this should be too hard, but couldn't really find any answers in the help files, either.