Params

Params
public static void UseParams(params int[] list)
    {
        for (int i = 0; i < list.Length; i++)
        {
            Console.Write(list[i] + " ");
        }
        Console.WriteLine();
    }

public void CallUseParams()
{
    UseParams(1, 2, 3, 4);
}

Komentarze

Popularne posty