IntPtr.Zero : IntPtr « unsafe « C# / CSharp Tutorial






using System;
using System.Runtime.InteropServices;

public class MainClass
{
  [STAThread]
  static void Main(string[] args)
  {
    IntPtr ptr = IntPtr.Zero;

    ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
    Marshal.FreeHGlobal(ptr);
  }
}








36.2.IntPtr
36.2.1.IntPtr.Zero
36.2.2.Fixing Managed Data in Memory