コード例 #1
0
        static void Main(string[] args)
        {
            TheClass testClass = new TheClass();
            TheStruct testStruct = new TheStruct();

            testClass.willChange = "Not changed";
            testStruct.willChange = "Not Changed";

            ClassTaker(testClass);
            StructTaker(testStruct);

            Console.WriteLine("Class field = {0}", testClass.willChange);
            Console.WriteLine("Struct field = {0}", testStruct.willChange);

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
コード例 #2
0
 //static methods
 static void ClassTaker(TheClass c)
 {
     c.willChange = "Changed";
 }