OC:
NSString *str = @"lu";
NSLog(@"%p - %p",str, &str);
Swift:
var str = "lu"
内存地址:
print(String(format: "%p", str))
指针地址:
let pointer = withUnsafePointer(to: &str, {$0})
print("(pointer)")
swift指针参考:http://www.cocoachina.com/articles/26419
https://blog.csdn.net/GuoHeroes/article/details/81043747
网友评论