"String" (编译类型)

"String"

表示一个字符串类型说明符.

更多信息

  • "String" 可使用于 Typed 和相关架构来指定一种类型.
  • "String" objects are automatically memory managed.

属性

  • 储存在 "String" 类型值中的字符与 String 表达式中的一样.

构建器

转换

    Expressions

  • "String" 对象可以与 String 表达式相互转换.
  • "CString"

  • 字符串可被转换为 "Managed"::["CString"] 对象.

范例

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

基本范例  (1)

"String" 可用作 CompiledCodeFunction 的输入和输出:

范围  (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.

可能存在的问题  (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: