Marshal::UnsafeAddrOfPinnedArrayElement<T> Method (array<T>^, Int32)
[Supported in the .NET Framework 4.5.1 and later versions]
Gets the address of the element at the specified index in an array of a specified type.
Assembly: mscorlib (in mscorlib.dll)
public: generic<typename T> [SecurityCriticalAttribute] static IntPtr UnsafeAddrOfPinnedArrayElement( array<T>^ arr, int index )
Parameters
- arr
-
Type:
array<T>^
The array that contains the desired element.
- index
-
Type:
System::Int32
The index of the desired element in the arr array.
Type Parameters
- T
The type of the array.
The array must be pinned by using a GCHandle before it is passed to this method. For maximum performance, this method does not validate the array passed to it; this can result in unexpected behavior.
SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Universal Windows Platform
Available since 8.1
.NET Framework
Available since 4.5.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Available since 8.1
.NET Framework
Available since 4.5.1
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Show: