System.IntPtr.Add Method

Adds an offset to the value of a pointer.

Syntax

[System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.MayCorruptInstance, System.Runtime.ConstrainedExecution.Cer.MayFail)]
public static IntPtr Add (IntPtr pointer, int offset)

Parameters

pointer
The pointer to add the offset to.
offset
The offset to add.

Returns

A new pointer that reflects the addition of offset to pointer.

Remarks

The IntPtr.Add(IntPtr, int) method does not throw an exception if the result is too large to represent as a pointer on the specified platform. Instead, the addition operation is performed in an unchecked context.

Languages that do not support operator overloading or custom operators can use this method to add an offset to the value of a pointer.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0