"RawPointer" (Compiled Type)
"RawPointer"::[t]
represents a pointer to an object with type t, suitable for use with external libraries.
Constructors
- ToRawPointer can be used to create a pointer object that is valid until the enclosing function returns.
Properties
- Information[ptr,"BaseType"] for ptr of type "RawPointer"::[t] gives "TypeSpecifier"::[t].
- FromRawPointer[ptr] returns the value pointed to by ptr.
Run-Time Errors
- Dereferencing a pointer with FromRawPointer is an unsafe operation. Attempting to dereference an invalid pointer can lead to a crash.
Examples
Basic Examples (2)
Create a "RawPointer"::["MachineInteger"], then dereference it:
Represent a library function that returns its results by modifying a pointer: