Last active
June 16, 2024 09:42
-
-
Save kirsteins/6d6e96380db677169831 to your computer and use it in GitHub Desktop.
Array -> UnsafeMutablePointer -> Array
This file contains 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 initalArray = [1, 2, 3] | |
let pointer: UnsafeMutablePointer<Int> = UnsafeMutablePointer(initalArray) | |
let arrary = Array(UnsafeBufferPointer(start: pointer, count: initalArray.count)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, according to Apple's document:
so, using
pointer
fromis undefined.