Skip to content

Instantly share code, notes, and snippets.

@vdonchev
Created March 9, 2016 08:12
Show Gist options
  • Select an option

  • Save vdonchev/76642475177fdc0c0199 to your computer and use it in GitHub Desktop.

Select an option

Save vdonchev/76642475177fdc0c0199 to your computer and use it in GitHub Desktop.
using System;
public static class Shits
{
public static void Main()
{
var num = 5;
var @double = 5.5;
var @string = "string";
// Извикване на метода без масив
Printer(num, @double, @string);
Console.WriteLine(new string('-', 25));
// Извикване на метода с масив
var array = new object[] {num, @double, @string};
Printer(array);
}
public static void Printer(params object[] itemsToPrint)
{
foreach (var item in itemsToPrint)
{
Console.WriteLine(item);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment