Will the called party function in the calling party function be changed?
Changes in the contents of the array will be reflected in the method of the caller, but there will be no changes in the parameter itself. For example:
public void Foo(int[] x) { // The effect of this line is visible to the caller x[0] = 10; // This line is pointless x = new int[] { 20 }; } ... int[] original = new int[10]; Foo(original); Console.WriteLine(original[0]); // Prints 10
Now, if we changed Foo to have a signature:
public void Foo(ref int[] x)
and changed the call code to:
Foo(ref original);
then he will print 20.
It is very important to understand the difference between the variable and the object to which its value belongs, as well as between the change in the object and the change in the variable.
See the article on passing parameters in C # for more information.
source share