public static void Show() { TheStruct a = new TheStruct(); TheClass b = new TheClass(); a.x = 1; b.x = 1; structtaker(a); classtaker(b); Console.WriteLine("Struct never change,Class changed"); Console.WriteLine("Struct a.x = {0}", a.x); Console.WriteLine("Class b.x = {0}", b.x); }
public static void structtaker(TheStruct s) { s.x = 5; }