# UIntPtr.Subtraction(UIntPtr, Int32)UIntPtr.Subtraction(UIntPtr, Int32)UIntPtr.Subtraction(UIntPtr, Int32)UIntPtr.Subtraction(UIntPtr, Int32) Operator

## 定義

``````public:
static UIntPtr operator -(UIntPtr pointer, int offset);``````
``public static UIntPtr operator - (UIntPtr pointer, int offset);``
``static member ( - ) : unativeint * int -> unativeint``
``Public Shared Operator - (pointer As UIntPtr, offset As Integer) As UIntPtr``

#### パラメーター

pointer
UIntPtr UIntPtr UIntPtr UIntPtr

オフセットを減算する符号なしポインター。The unsigned pointer to subtract the offset from.

offset
Int32 Int32 Int32 Int32

#### 戻り値

`offset` からの `pointer` の減算が反映された新しい符号なしポインター。A new unsigned pointer that reflects the subtraction of `offset` from `pointer`.

## 注釈

Subtractionメソッド定義の減算演算UIntPtrオブジェクト。The Subtraction method defines the subtraction operation for UIntPtr objects. コードは、次のようにできます。It enables code such as the following.

``````int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
UIntPtr ptr = (UIntPtr) arr[arr.GetUpperBound(0)];
for (int ctr = 0; ctr <= arr.GetUpperBound(0); ctr++)
{
UIntPtr newPtr = ptr - ctr;
Console.Write("{0}   ", newPtr);
}
``````
``````Dim arr() As Integer = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Dim ptr As UIntPtr = CType(arr(arr.GetUpperBound(0)), UIntPtr)
For ctr As Integer= 0 To arr.GetUpperBound(0)
Dim newPtr As UIntPtr = UIntPtr.Subtract(ptr, ctr)
Console.Write("{0}   ", newPtr)
Next
``````

カスタム演算子をサポートしない言語を呼び出すことができます、Subtractメソッド代わりにします。Languages that do not support custom operators can call the Subtract method instead.