有个问题比较疑惑,定义常量字符串的问题,以下代码:NSString * const kSomeConstantString = @"";
与const NSString * kSomeConstantString = @"";
有何区别?
高洛峰2017-04-17 12:03:25
const type * variable name: you can change the pointer’s pointer, but you cannot change the content pointed to by the pointer.
Type * const variable name: The content pointed to by the pointer can be changed, but the pointing of the pointer cannot be changed.
Reference address