Esempio n. 1
0
        static void Main(string[] args)
        {
            RefPoint rp = new RefPoint(2, 2);
            ValPoint vp = new ValPoint(2, 2);

            f_byval(rp);
            g_byval(vp);

            Console.WriteLine("Reference Type By Value: " + rp.Y);
            Console.WriteLine("Value Type By Value: " + vp.Y);

            f_byref(ref rp);
            g_byref(ref vp);

            Console.WriteLine("Reference Type By Ref: " + rp.Y);
            Console.WriteLine("Value Type By Ref: " + vp.Y);
        }
Esempio n. 2
0
 static void g_byref(ref ValPoint vp)
 {
     vp.Y = 4444;
 }
Esempio n. 3
0
 static void g_byval(ValPoint vp)
 {
     vp.Y = 1234;
 }