When you want to pass an array to a method, you could first declare the array and then pass the array by name to the method.
Suppose that you have a Dog method that looks like this:
public void DoBarks(string[] barkSounds)
{
foreach (string s in barkSounds)
Console.WriteLine(s);
}
You can declare the array and pass it to the method:
Dog d = new Dog();
// Declare array and then pass
string[] set1 = { "Woof", "Rowf" };
d.DoBarks(set1);
Read more: 2,000 Things You Should Know About C#
QR: ![Inline image 1](http://chart.googleapis.com/chart?chs=80x80&cht=qr&choe=UTF-8&chl=http://csharp.2000things.com/2013/02/04/772-initializing-an-array-as-part-of-a-method-call/)