FromRawPointer
returns the value referred to by the pointer p for use in compiled code.
FromRawPointer[array,offset]
returns the value of a C array at an offset.
Details
- FromRawPointer is only available in compiled code.
- Running FromRawPointer on invalid inputs can lead to crashes.
- FromRawPointer can work with pointers and arrays.
- Usages of FromRawPointer have the following approximate equivalents in C:
-
FromRawPointer[p] *p FromRawPointer[array,offset] array[offset] or *(array+offset)
Examples
open allclose allScope (1)
Offset (1)
FromRawPointer can extract different elements of an array:
Applications (2)
Represent a library function that returns its results by modifying a pointer:
Compile a program that uses the function:
Represent a library function that populates a "CArray" with a sequence of square numbers:
Compile a program that uses FromRawPointer to extract elements of the populated array:
Text
Wolfram Research (2022), FromRawPointer, Wolfram Language function, https://reference.wolfram.com/language/ref/FromRawPointer.html.
CMS
Wolfram Language. 2022. "FromRawPointer." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FromRawPointer.html.
APA
Wolfram Language. (2022). FromRawPointer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FromRawPointer.html