using System;
public class Program
{
static void initArray(ref int[] arr)
arr = new int[] {0, 0, 0};
}
/*
When an array is initialized as an empty array, it is passed to a function not as a pointer (since it does not point anywhere in memory)
these as a regular variable, like int (passed By Vale). Therefore the function creates another place in the memory
and also inserts a variable of an array type, Just as would happen if we were to send an int type variable to a function.
If we want it to refer to the same array, we must send the variable address (which in this case is an array type) to the function.
If it would be an array that contains variables, Then it is already a pointer to the an array,
which the system will already send it By ref to the function, And then the function will work on the same array as the program.
*/
public static void Main(string[] args)
int[] arr = {};
initArray(ref arr);
// Output 0
Console.WriteLine(arr[0]);