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]);
}
}
C#不定长参数
猜你喜欢
转载自www.cnblogs.com/ezhar/p/12913403.html
今日推荐
周排行