The type checker allows you topass a
Stringvalue to anUnsafePointer<Int8>orUnsafePointer<UInt8>parameter. When you do that, the compiler will transparently create a buffer containing the UTF-8-encoded, null-terminated string, and pass a pointer to that buffer to the function.[…]
However, some C functions take an array of strings (a
char **orchar *[]), and there is no built-in support in Swift for passing a[String]to achar **parameter.[…]
The full type of the
strlenfunction as imported by Swift looks like this[…]
C Programming LanguageLanguage DesignMemory ManagementProgrammingSwift Programming Language
Black Friday
Blog
Archives
Tag Cloud
Top Posts
Recently Updated
RSS Feed ·Comments
Mastodon ·Twitter
Apple News
Trackback
Support this site viaPatreon.
Try my Mac apps: