EddyHahn
(Eddy Hahn)
1
Hi,
I have a C function (foo(void*) value) and I need to call it from Swift. Swift imports the parameter as UnsafeMutableRawPointer. I cannot figure out how to create one with the memory address (such as 8).
foo( (void *) 8);
Any idea
Thanks,
Eddy
Joe_Groff
(Joe Groff)
2
You can construct pointers from bit patterns using the bitPattern: initializers, e.g. UnsafeMutableRawPointer(bitPattern: 8)!
3 Likes