Created
March 2, 2017 07:56
-
-
Save el-hoshino/b86aaf4cf0d23d7544249b74bd5a1072 to your computer and use it in GitHub Desktop.
そういえば今日unsafePointerの話あったけど、ポインター使うとこんなこともできるよ #CodePiece #tryswiftconf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var age = 28 | |
let unknown = withUnsafePointer(to: &age) { $0.advanced(by: 12).pointee } | |
print(unknown) // 7597125269629269102 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment