Some "safe" languages like Swift and Go offer "unsafe" pointers for use with APIs written in languages like C and Objective-C. Questions using this tag should also have the relevant language tag, e.g. [swift] or [go].
Trying to pass "self" to a C function in swift, when calling following code: var callbackStruct : AURenderCallbackStruct = AURenderCallbackStruct.init( inputProc: …
swift pointers casting unsafe-pointersI want to get pointer of first entry in the array. This is how I tried int[] Results = { 1, 2, 3, 4, 5 }; unsafe { int* …
c# unsafe-pointersMy code snipet as follows …: let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) { SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)) } … does no longer compile with the …
swift3 unsafe-pointers xcode8-beta6I have a receipt validation class that is deprecated since Swift 3 has released. I fixed some issues, but I still …
ios swift3 unsafe-pointersI previously used this code in Swift 4.2 to generate an id: public static func generateId() throws -> UInt32 { let …
swift deprecated unsafe-pointersHow does one access bytes (or Int16's, floats, etc.) out of memory pointed to by an UnsafeMutableRawPointer (new in …
swift unsafe-pointersI'm looking for the simplest ways to achieve reasonable C interoperability in Swift, and my current block is converting an …
c arrays swift unsafe-pointersIs there a way to use reflect to access unexported fields in Go 1.8? This no longer seems to work: https://…
go reflection unsafe-pointersI'm unfamiliar with Objective C. I'm using a private framework and need to be able to change one of the …
objective-c swift pointers casting unsafe-pointersI'm trying to understand the use of pointers in Swift, in particular: Unsafe[Mutable]Pointer and UnsafeRaw[Mutable]Pointer. I …
swift pointers unsafe-pointers unsafemutablepointer