Skip to content

Instantly share code, notes, and snippets.

@bofh
Created October 28, 2015 10:17
Show Gist options
  • Save bofh/76fb2dc84ef805a8a66c to your computer and use it in GitHub Desktop.
Save bofh/76fb2dc84ef805a8a66c to your computer and use it in GitHub Desktop.
import Foundation
import Darwin
func readInt() -> Int {
var res: Int = 0
withUnsafePointer(&res) {
vscanf("%d", getVaList([COpaquePointer($0)]))
}
return res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment