I\'d like to use a default parameter value of IntPtr.Zero in a function that takes an IntPtr as an argument. This is not possible as IntPtr.Zero is
IntPtr
IntPtr.Zero
Somewhat unintuitive, to put it mildly, you get it by using the new operator:
void Foo(IntPtr arg = new IntPtr()) { }
That was for fun, you probably enjoy this one better:
void Foo(IntPtr arg = default(IntPtr)) { }