public struct Forecast
{
public int Temperature { get; set; }
public int Pressure { get; set; }
}
class Program
{
public static void ChangeTheString(string weather) { weather = "sunny"; }
public static void ChangeTheArray(string[] rainyDays) { rainyDays = new[]{"Sunday", "Tuesday"}; }
public static void ChangeTheStructure(Forecast forecast) { forecast.Temperature = 35; }
static void Main(string[] args)
{
string weather = "rainy";
ChangeTheString(weather);
System.Console.WriteLine("The weather is " + weather);
string[] rainyDays = new[] {"Monday", "Friday" };
ChangeTheArray(rainyDays);
System.Console.WriteLine("The rainy days were on " + rainyDays[0] + " and "+rainyDays[1]);
Forecast forecast = new Forecast {Pressure = 700, Temperature = 20 };
ChangeTheStructure(forecast);
System.Console.WriteLine("The temperature is " +forecast.Temperature + "C");
System.Console.ReadKey();
}
}
cHVibGljIHN0cnVjdCBGb3JlY2FzdAp7CglwdWJsaWMgaW50IFRlbXBlcmF0dXJlIHsgZ2V0OyBzZXQ7IH0KCXB1YmxpYyBpbnQgUHJlc3N1cmUgeyBnZXQ7IHNldDsgfQp9CiAKY2xhc3MgUHJvZ3JhbQp7CglwdWJsaWMgc3RhdGljIHZvaWQgQ2hhbmdlVGhlU3RyaW5nKHN0cmluZyB3ZWF0aGVyKSB7IHdlYXRoZXIgPSAic3VubnkiOyB9CglwdWJsaWMgc3RhdGljIHZvaWQgQ2hhbmdlVGhlQXJyYXkoc3RyaW5nW10gcmFpbnlEYXlzKSB7IHJhaW55RGF5cyA9IG5ld1tdeyJTdW5kYXkiLCAiVHVlc2RheSJ9OyB9CglwdWJsaWMgc3RhdGljIHZvaWQgQ2hhbmdlVGhlU3RydWN0dXJlKEZvcmVjYXN0IGZvcmVjYXN0KSB7IGZvcmVjYXN0LlRlbXBlcmF0dXJlID0gMzU7IH0KCXN0YXRpYyB2b2lkIE1haW4oc3RyaW5nW10gYXJncykKCXsKCQlzdHJpbmcgd2VhdGhlciA9ICJyYWlueSI7CgkJQ2hhbmdlVGhlU3RyaW5nKHdlYXRoZXIpOwoJCVN5c3RlbS5Db25zb2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