"String" (Compiled Type)
"String"
represents a string type specifier.
Details
- "String" can be used in Typed and related constructs to specify a type.
- "String" objects are automatically memory managed.
Properties
- The characters stored in a "String" type value are the same as those in a String expression.
Constructors
- CreateTypeInstance["String",cstr,len] creates a string from a C string cstr with length len. cstr can have type "CString" or "Managed"::["CString"].
- CreateTypeInstance["String",cstr] creates a string from a null-terminated C string cstr.
Examples
open allclose allBasic Examples (1)
"String" can be used as input and output from a CompiledCodeFunction:
Scope (1)
Cast a string to a "Managed"::["CString"] and print its contents:
When a managed object is passed to a function from a library, the raw object is automatically unpacked.
When a managed object is no longer used, it frees its contents.
Possible Issues (1)
A string can be cast to a "CString", but the result will need to be freed with a call to DeleteObject when it is no longer used: