How can I pass a Swift string to a function c?
I am having serious problems passing a string from swift to a function written with c.
I am trying to do this in my swift code
var address = "192.168.1.2"
var port = 8888
initSocket(address, port)
The c function looks like this:
void initSocket(char *address, int port);
Im getting the error: Cannot convert expression of type "Void" to type "CMutablePointer"
I cannot find a solution that works.
+3
source to share