using System;
public class Test
{
private static void assign(ref int i)
{
i = 42;
}
public static void Main()
{
var vars = new [] { 1,2,3,4 };
Console.WriteLine(vars[2]);
assign(ref vars[2]);
Console.WriteLine(vars[2]);
}
}
CXVzaW5nIFN5c3RlbTsKCglwdWJsaWMgY2xhc3MgVGVzdAoJewoJICAgICAgICBwcml2YXRlIHN0YXRpYyB2b2lkIGFzc2lnbihyZWYgaW50IGkpCgkgICAgICAgIHsKCSAgICAgICAgICAgICBpID0gNDI7CgkgICAgICAgIH0KCQoJICAgICAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgkgICAgICAgIHsKCSAgICAgICAgICAgICAgdmFyIHZhcnMgPSBuZXcgW10geyAxLDIsMyw0IH07CgkgICAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKHZhcnNbMl0pOwoJICAgICAgICAgICAgICBhc3NpZ24ocmVmIHZhcnNbMl0pOwoJICAgICAgICAgICAgICBDb25zb2xlLldyaXRlTGluZSh2YXJzWzJdKTsKCSAgICAgICAgfQoJfQ==