Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

将Swift结构转换为UnsafeMutablePointer

据我所知,最短的方法是:

var myStruct = TheStruct()var address = withUnsafeMutablePointer(&myStruct) {UnsafeMutablePointer<Void>(
func foo(arg:UnsafeMutablePointer<Void>) {    //...}var myStruct = TheStruct()foo(&myStruct)
)}

但是,为什么需要这个呢?如果要将其作为参数传递,则可以(并且应该):

[+++]


)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
将Swift结构转换为UnsafeMutablePointer_随笔_内存溢出

将Swift结构转换为UnsafeMutablePointer

将Swift结构转换为UnsafeMutablePointer,第1张

将Swift结构转换为UnsafeMutablePointer

据我所知,最短的方法是:

var myStruct = TheStruct()var address = withUnsafeMutablePointer(&myStruct) {UnsafeMutablePointer<Void>(
func foo(arg:UnsafeMutablePointer<Void>) {    //...}var myStruct = TheStruct()foo(&myStruct)
)}

但是,为什么需要这个呢?如果要将其作为参数传递,则可以(并且应该):



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5620099.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存