美文网首页
Purebasic Map 指针 传递 遍历

Purebasic Map 指针 传递 遍历

作者: Spooking | 来源:发表于2022-07-09 11:30 被阅读0次
NewMap Country.s()

Country("US") = "United States"
Country("FR") = "France"
Country("GE") = "Germany"


Define *mp= PeekI(@Country()-4*3)  ;map对象起始位置
Define mpl= PeekI(*mp+16)          ;map对象子元素数量
;用指针遍历 map 对象的键和值
Define i
For i=0 To mpl-1
  Debug "Key: "+ PeekS(PeekI(*mp+32+i*16))
  Debug "Val: "+ PeekS(PeekI(*mp+36+i*16))
Next

相关文章

网友评论

      本文标题:Purebasic Map 指针 传递 遍历

      本文链接:https://www.haomeiwen.com/subject/aiwbbrtx.html