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

- Supported values of ptr include RawPointer expressions and ManagedObject expressions whose values are pointers.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Allocate an object of type "CInt":

https://wolfram.com/xid/0dqwiufp3f2-2o7ot0
Write a value to the raw memory:

https://wolfram.com/xid/0dqwiufp3f2-x04r7d


https://wolfram.com/xid/0dqwiufp3f2-ehrpuk

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

https://wolfram.com/xid/0dqwiufp3f2-klczv8
Initialize the raw memory with random numbers between 0 and 1:

https://wolfram.com/xid/0dqwiufp3f2-ieownp
Import the values of the raw memory as a list:

https://wolfram.com/xid/0dqwiufp3f2-t44xur

Scope (1)Survey of the scope of standard use cases
RawMemoryWrite supports passing a managed pointer as its first argument:

https://wolfram.com/xid/0dqwiufp3f2-65xwac


https://wolfram.com/xid/0dqwiufp3f2-9mwcxd

It also supports passing a non-managed pointer:

https://wolfram.com/xid/0dqwiufp3f2-ouydea


https://wolfram.com/xid/0dqwiufp3f2-8op9ak

Properties & Relations (1)Properties of the function, and connections to other functions
Allocate a buffer of 5 objects of type "Integer16" and fill it with the value -1:

https://wolfram.com/xid/0dqwiufp3f2-66ymsm
RawMemoryExport can be used for the same purpose:

https://wolfram.com/xid/0dqwiufp3f2-zur0p1

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.
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.
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
Wolfram Language. (2023). RawMemoryWrite. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RawMemoryWrite.html
BibTeX
@misc{reference.wolfram_2025_rawmemorywrite, author="Wolfram Research", title="{RawMemoryWrite}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/RawMemoryWrite.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_rawmemorywrite, organization={Wolfram Research}, title={RawMemoryWrite}, year={2023}, url={https://reference.wolfram.com/language/ref/RawMemoryWrite.html}, note=[Accessed: 19-June-2025
]}