Pass reference by reference vs pass reference by value - C#
问题 Greetings, I get the difference between pass by value and pass by reference. But pass reference (such as array) by ref and pass array by value is something i can't seem to comprehend. How can you pass a reference by reference? int[] myArray = {1,2,3}; PassByVal(myArray); PassByRef(ref myArray); PassByVal(int[] array) { array = new int[] {7,8,9}; // will not work } PassByRef(ref int[] array) { array = new int[] {10,11,12}; } // will work 回答1: I suggest that you check out this link. It's quite