Language

Unsafe.Write(Void*, T) Method

Definition

Important

This API is not CLS-compliant.

Writes a value of type T to the given location.

public:
generic 
 static void Write(void* destination, T value);
[System.CLSCompliant(false)]
public static void Write(void* destination, T value) where T : allows ref struct;
public static void Write(void* destination, T value);
[System.CLSCompliant(false)]
public static void Write(void* destination, T value);
[]
static member Write : nativeptr * 'T -> unit
static member Write : nativeptr * 'T -> unit

Type Parameters

T

The type of the value to write.

Parameters

destination
Void*

The location to write to.

value
T

The value to write.

Attributes

Remarks

Caution

The caller must ensure that there are SizeOf() bytes of writable memory available starting at the location pointed to by destination. Access violations may occur if this requirement is not met.

destination is assumed to be a properly aligned pointer to a value of type T. For more information on alignment assumptions, see ECMA-335, Sec. I.12.6.2 ("Alignment").

Applies to