The new IntPtr.Add method - am I missing the point of the int?
问题 Starting from FW 4.0, the IntPtr structure has the Add method: public static IntPtr Add( IntPtr pointer, int offset ) Which is great, as it's supposed to address all those questions on IntPtr math we have had (1, 2, probably more). But why is the offset int ? Must it not be IntPtr ? I can easily imagine offsetting a 64-bit pointer by a value which is beyond the int range. For instance, consider Marshal.OffsetOf: public static IntPtr OffsetOf( Type t, string fieldName ) It returns an IntPtr as