using System; public class Test { public static void Copy(IntPtr ptr) { ptr = (IntPtr)(0xffffffff); } public static void Ref(ref IntPtr ptr) { ptr = (IntPtr)(0xffffffff); } public static void Main() { IntPtr ptr = IntPtr.Zero; Copy(ptr); Console.WriteLine("0x{0}", ptr.ToString("x")); Ref(ref ptr); Console.WriteLine("0x{0}", ptr.ToString("x")); } }