-1

Is there a way I could convert a String to an UnsafeMutablePointer<UInt8> in Swift language, avoiding data loss?

Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
ch_studend
  • 91
  • 2
  • 10

1 Answers1

0
let s = "83"
var i: UInt8 = UInt8.init(s)!
let up: UnsafeMutablePointer<UInt8> = UnsafeMutablePointer<UInt8>.init(&i)
itlijunjie
  • 61
  • 1
  • 4