Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# use readonly array as method default

private static readonly int[] FooDefault = new int[] { 5, 10 };
public void Foo(int[] x = null)
{
    x = x ?? FooDefault;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #readonly #array #method #default
ADD COMMENT
Topic
Name
2+9 =