RawMemoryWrite

RawMemoryWrite[ptr,val]

往指针 ptr 处的原始内存写入用二进制表示的 val.

RawMemoryWrite[ptr,val,offset]

往偏移指针处写入.

更多信息

范例

打开所有单元关闭所有单元

基本范例  (2)

为一个类型为 "CInt" 的对象分配内存:

往原始内存中写入一个值:

读取该值:

为 10 个类型为 "CFloat" 的对象分配原始内存:

用 0 到 1 之间的随机数字初始化原始内存:

将原始内存的值导入为列表:

范围  (1)

RawMemoryWrite 支持将托管指针作为其第一个参数进行传递:

它也支持传递非托管指针:

属性和关系  (1)

为 5 个类型为 "Integer16" 的对象分配缓存,并写入值 -1

同样,可以使用 RawMemoryExport

Wolfram Research (2023),RawMemoryWrite,Wolfram 语言函数,https://reference.wolfram.com/language/ref/RawMemoryWrite.html.

文本

Wolfram Research (2023),RawMemoryWrite,Wolfram 语言函数,https://reference.wolfram.com/language/ref/RawMemoryWrite.html.

CMS

Wolfram 语言. 2023. "RawMemoryWrite." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/RawMemoryWrite.html.

APA

Wolfram 语言. (2023). RawMemoryWrite. Wolfram 语言与系统参考资料中心. 追溯自 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: 05-November-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: 05-November-2024 ]}