title: Array of Swift Strings into const char * const *
body: <p>I am having trouble converting an array of Swift Strings into an array for a c function with the signature:</p>
  
  <pre><code>PGconn *PQconnectStartParams(const char * const *keywords, const char * const *values, int expand_dbname)
  </code></pre>
  
  <p>In Swift, the <strong>const char * const *</strong> shows up as:</p>
  
  <pre><code>&lt;UnsafePointer&lt;UnsafePointer&lt;Int8&gt;&gt;
  </code></pre>
  
  <p>So I try to convert the contents of a Dictionary [String:String] called 'options' and feed that to the function as follows:</p>
  
  <pre><code>var keys = [[Int8]]()
  var values = [[Int8]]()
  for (key, value) in options {
      var int8Array = key.cStringUsingEncoding(NSUTF8StringEncoding)!
      keys.append(int8Array)
      int8Array = value.cStringUsingEncoding(NSUTF8StringEncoding)!
              values.append(int8Array)
  }
  pgConnection = PQconnectStartParams(UnsafePointer(keys), UnsafePointer(values), 0)
  </code></pre>
  
  <p>It compiles and runs, but the function does not work.</p>
  
  <p>Any insight would be greatly appreciated.</p>