My code in kotlin / fun myArray() = intArrayOf(1,2...
# kotlin-native
s
My code in kotlin / fun myArray() = intArrayOf(1,2,3)
o
In C/C++ Kotlin primitive arrays could be passed as C pointers: https://github.com/JetBrains/kotlin-native/blob/master/INTEROP.md#passing-pointers-to-bindings
s
Do you have some sample for that case? In my case I call kotlin code from C. In my header file I got cinterop_CValues as returned type but I am not sure how can I use it.
o
when calling Kotlin from C accessor methods getting element by index could be implemented. Generally we export to C only what programmer explicitly written, not stdlib operations
s
So at this moment I can not return arrays from kotlin to C?
o
you can return anything you want, but need to provide required accessors yourself, we will try to fix it in upcoming version of C interop