cs_array_out.cs

来自「java基础方面的一些实例代码」· CS 代码 · 共 25 行

CS
25
字号
// cs_array_out.cs
using System; 
class TestOut 
{
	static public void FillArray(out int[] myArray) 
	{
		// Initialize the array:
		myArray = new int[5] {1, 2, 3, 4, 5};
	}

	static public void Main() 
	{
		int[] myArray; // Initialization is not required

		// Pass the array to the callee using out:
		FillArray(out myArray);

		// Display the array elements:
		Console.WriteLine("Array elements are:");
		for (int i=0; i < myArray.Length; i++)
			Console.WriteLine(myArray[i]);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?