Esempio n. 1
0
 static void Main(string[] args)
 {
     MyClass myClass = new MyClass();
     myClass.change = "no changes";
     MyStruct myStruct = new MyStruct();
     myStruct.change = "no changes";
     ClassTaker(myClass);
     StructTaker(myStruct);
     Console.WriteLine(myClass.change);//changed
     Console.WriteLine(myStruct.change);// no changes
     Console.ReadLine();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            MyClass myClass1 = new MyClass();
            MyStruct mySrtuct1 = new MyStruct();

            myClass1.change = "didn't change";
            mySrtuct1.change = "didn't change";
            ClassTaker(myClass1);
            StructTaker(mySrtuct1);
            Console.WriteLine("Class " + myClass1.change);
            Console.WriteLine("Struct " + mySrtuct1.change);

            Console.ReadKey();
        }
Esempio n. 3
0
 static void ClassTaker(MyClass myClass)
 {
     myClass.change = "changed";
 }
Esempio n. 4
0
 public static void ClassTaker(MyClass myClass)
 {
     myClass._change = "Changed";
 }
Esempio n. 5
0
 static void ClassTaker(MyClass myClass)
 {
     myClass.change = "Text from ClassTaker";
 }
 static void ClassTaker(MyClass myClass)
 {
     myClass.change = "изменено";
 }
Esempio n. 7
0
 static void ClassTaker(MyClass myClass)
 {
     myClass.change = "changed";
 }