1 Reply
      Latest reply: Feb 17, 2017 4:25 AM by eskimo RSS
      Zorjan Level 1 Level 1 (0 points)

        Null-terminated c string.

        var pem_key = calloc(keylen+1, 1); / Null-terminate */
        
        let cT1 = String(cString: pem_key)
        
        

         

        How to get String in Swift3?

         

        The error is:

        Cannot invoke initializer for type 'String' with an argument list of type '(cString: UnsafeMutableRawPointer?)'

        Overloads for 'String' exist with these partially matching parameter lists: (cString: UnsafePointer<CChar>), (cString: UnsafePointer<UInt8>)