Skip to content

Instantly share code, notes, and snippets.

@k0nserv
Last active August 29, 2015 14:27
Show Gist options
  • Save k0nserv/30e9156797eeddff96d1 to your computer and use it in GitHub Desktop.
Save k0nserv/30e9156797eeddff96d1 to your computer and use it in GitHub Desktop.
Reinterpret casting in Swift
uint32_t test[2] = { 0xFF28A9C9, 0xAC912F9D };
uint8_t *test2 = reinterpret_cast<uint8_t *>(test);
let test: [UInt32] = [0xFF28A9C9, 0xAC912F9D]
let test2 = test as UnsafeMutablePointer<UInt8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment