title: How to pass a Swift string to a c function?
body: <p>I am having serious trouble passing a string from swift, to a function written in c.</p>
  
  <p>I'm trying to do this in my swift code</p>
  
  <pre><code>var address = "192.168.1.2"
  var port = 8888
  
  initSocket(address, port)
  </code></pre>
  
  <p>The c function looks like this:</p>
  
  <pre><code>void initSocket(char *address, int port);
  </code></pre>
  
  <p>Im getting the error:
  Cannot convert the expression's of type 'Void' to type 'CMutablePointer'</p>
  
  <p>I can't seem to find a solution that works.</p>