Unsafe.Write<T>(Void*, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Important
This API is not CLS-compliant.
Writes a value of type T
to the given location.
public:
generic <typename T>
static void Write(void* destination, T value);
public static void Write<T> (void* destination, T value);
[System.CLSCompliant(false)]
public static void Write<T> (void* destination, T value);
static member Write : nativeptr<unit> * 'T -> unit
[<System.CLSCompliant(false)>]
static member Write : nativeptr<unit> * '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<T>()
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
Feedback
https://aka.ms/ContentUserFeedback.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru