C# PlayGround

CSharp · Console

/Program.cs

using System;
					
public class Program
{
	public static void Main()
	{
		var array = new[] { 
			new Foo { bar = 1 },
			new Foo { bar = 2 },
			new Foo { bar = 3 },
		};
		array[1].bar = 42;
		Console.WriteLine(array[1].bar);
	}
}

struct Foo
{
	public int bar;
}
;