How can I pass a Kotlin `String` to a C function?
# kotlin-native
a
How can I pass a Kotlin
String
to a C function?
d
depends on your c function signature but you can find info here: https://github.com/JetBrains/kotlin-native/blob/master/INTEROP.md#working-with-the-strings
a
I got a function that takes a char * as a param, Insted of using the .cstr everytime im using the function inside Kotlin, I just want to pass it in advance
o
not sure what exactly you’re trying to achieve, but
aString.cstr.getPointer(arena)
will produce a C pointer with lifetime bound to certain arena