why the item is not replaced
public static void SwapArray(int[,] arr) { for (int i = 0; i < arr.GetLength(0); i++) { for (int j = 0; j < arr.GetLength(0); j++) { int temp = arr[i, j]; arr[i, j] = arr[j, i]; arr[j, i] = temp; } } }
even if the parameter does not have the ref modifier, the array does not change. Is a copy of the link passed as a parameter to the right?
Coffeecode
source share