RawMemoryWrite

RawMemoryWrite[ptr,val]

writes a binary representation of val to the raw memory at the pointer ptr.

RawMemoryWrite[ptr,val,offset]

writes to an offset pointer.

Details

Examples

open allclose all

Basic Examples  (2)

Allocate an object of type "CInt":

Write a value to the raw memory:

Read the value:

Allocate a raw memory of 10 objects of type "CFloat":

Initialize the raw memory with random numbers between 0 and 1:

Import the values of the raw memory as a list:

Scope  (1)

RawMemoryWrite supports passing a managed pointer as its first argument:

It also supports passing a non-managed pointer:

Properties & Relations  (1)

Allocate a buffer of 5 objects of type "Integer16" and fill it with the value -1:

RawMemoryExport can be used for the same purpose:

Wolfram Research (2023), RawMemoryWrite, Wolfram Language function, https://reference.wolfram.com/language/ref/RawMemoryWrite.html.

Text

Wolfram Research (2023), RawMemoryWrite, Wolfram Language function, https://reference.wolfram.com/language/ref/RawMemoryWrite.html.

CMS

Wolfram Language. 2023. "RawMemoryWrite." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RawMemoryWrite.html.

APA

Wolfram Language. (2023). RawMemoryWrite. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RawMemoryWrite.html

BibTeX

@misc{reference.wolfram_2024_rawmemorywrite, author="Wolfram Research", title="{RawMemoryWrite}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/RawMemoryWrite.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_rawmemorywrite, organization={Wolfram Research}, title={RawMemoryWrite}, year={2023}, url={https://reference.wolfram.com/language/ref/RawMemoryWrite.html}, note=[Accessed: 22-December-2024 ]}