plugins: change return codes of geany_load_module() and GeanyPluginFuncs::init
[geany-mirror.git] / tests / ctags / array_ref_and_out.cs
blobcc4cd2a9faa3703460bb85e05010e1e8cae6c658
1 // Programmer's Reference: Passing Array Using ref and out
2 public static void MyMethod(out int[] arr)
4 arr = new int[10]; // definite assignment of arr
7 public static void MyMethod(ref int[] arr)
9 arr = new int[10]; // arr initialized to a different array
12 using System;
13 class TestOut
15 static public void FillArray(out int[] myArray)
17 // Initialize the array:
18 myArray = new int[5] {1, 2, 3, 4, 5};
21 static public void Main()
23 int[] myArray; // Initialization is not required
25 // Pass the array to the callee using out:
26 FillArray(out myArray);
28 // Display the array elements:
29 Console.WriteLine("Array elements are:");
30 for (int i=0; i < myArray.Length; i++)
31 Console.WriteLine(myArray[i]);