C#不定长参数
Test(5,6,7,8,9,10);
void Test(int sd, params int[] arr)//不定长参数前要加params
{
for(int i = 0 ; i < arr.Length; i++)
{
Console.WriteLine(i+"---"+arr[i]);
}
}
Result:
本文来自博客园,作者:艾孜尔江,转载请注明原文链接:https://www.cnblogs.com/ezhar/p/12913403.html