How to pass a Swift string to a c function?
Swift CStrings work seamlessly with C constant strings, so use
void initSocket(const char *address, int port);
instead of char*
argument, and declare your address
variable as CString:
var address: CString = "192.168.1.2";