## Marshal::PtrToStringAuto(IntPtr) method


Creates a managed [String](../../../system/string/) from an unmanaged zero-terminated string.

```cpp
static String System::Runtime::InteropServices::Marshal::PtrToStringAuto(IntPtr ptr)
```


| Parameter | Type | Description |
| --- | --- | --- |
| ptr | IntPtr | Pointer to the unmanaged string. |

### ReturnValue

A managed string.

## See Also

* Class [String](../../../system/string/)
* Class [Marshal](../)
* Namespace [System::Runtime::InteropServices](../../)
* Library [Aspose.TeX for C++](../../../)
## Marshal::PtrToStringAuto(IntPtr, int) method


Creates a managed [String](../../../system/string/) from an unmanaged string.

```cpp
static String System::Runtime::InteropServices::Marshal::PtrToStringAuto(IntPtr ptr, int length)
```


| Parameter | Type | Description |
| --- | --- | --- |
| ptr | IntPtr | Pointer to the unmanaged string. |
| length | int | Length of the unmanaged string. |

### ReturnValue

A managed string.

## See Also

* Class [String](../../../system/string/)
* Class [Marshal](../)
* Namespace [System::Runtime::InteropServices](../../)
* Library [Aspose.TeX for C++](../../../)
