UIntPtr - Add

Adds an offset to the value of an unsigned pointer.

Try it

public static void Main()
{
	int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  	UIntPtr ptr = (UIntPtr) arr[0];
  	for (int ctr = 0; ctr < arr.Length; ctr++)
  	{
		// C# Extension Method: UIntPtr - Add
     	UIntPtr newPtr = ptr.Add(ctr);
     	Console.Write("{0}   ", newPtr);
  	} 
}

View Source
using System;

public static partial class Extensions
{
    /// <summary>
    ///     Adds an offset to the value of an unsigned pointer.
    /// </summary>
    /// <param name="pointer">The unsigned pointer to add the offset to.</param>
    /// <param name="offset">The offset to add.</param>
    /// <returns>A new unsigned pointer that reflects the addition of  to .</returns>
    public static UIntPtr Add(this UIntPtr pointer, Int32 offset)
    {
        return UIntPtr.Add(pointer, offset);
    }
}