---
title: "withCString(_:)"
framework: system
role: symbol
role_heading: Instance Method
path: "system/filepath/withcstring(_:)"
---

# withCString(_:)

For backwards compatibility only. This function is equivalent to the preferred withPlatformString.

## Declaration

```swift
func withCString<Result>(_ body: (UnsafePointer<CChar>) throws -> Result) rethrows -> Result
```
