Beispiel #1
0
        static void Main()
        {
            TheClass  testClass  = new TheClass();
            TheStruct testStruct = new TheStruct();

            testClass.willIChange  = "Not Changed";
            testStruct.willIChange = "Not Changed";

            ClassTaker(testClass);
            StructTaker(testStruct);

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

            // Keep the console window open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
Beispiel #2
0
 static void StructTaker(TheStruct s)
 {
     s.willIChange = "Changed";
 }