Esempio n. 1
0
        static void Main(string[] args)
        {
            MyNumberClass classVal = new MyNumberClass();

            classVal.value = 3;

            MyNumberStruct structVal = new MyNumberStruct();

            structVal.value = 3;

            AddTo(classVal, 1);
            AddTo(structVal, 1);

            Console.WriteLine("AddTo class = " + classVal);
            Console.WriteLine("AddTo struct = " + structVal);
            Console.ReadKey();
        }
Esempio n. 2
0
 static void AddTo(MyNumberClass x, int y)
 {
     x.value += y;
 }