When bridging with C and passing String
to C functions expecting const char*
or pointers - are wrapper functions like withCString
or withUnsafe(Mutable)Pointer(to:)
strictly necessary? I've found conflicting information when googling. On the other hand, compiler happily accepts the parameters as they are and everything seems to work.
An explanation on C interop or a pointer (pun intended) to detailed (and up to-date) documentation would be greatly appreciated.
Thanks.