static const Vs extern const

前端 未结 7 2101
傲寒
傲寒 2020-12-07 19:34

I have been using static const in my header files as so:

static NSString * const myString = @\"foo\";

But have read that this is not the \'

7条回答
  •  悲哀的现实
    2020-12-07 20:03

    #define myString @"foo"
    

    There is example why:

    You will be able concatenate strings in compile time:

    NSLog(@"%@", @"Say hello to " myString);
    

    will output: Say hello to foo

提交回复
热议问题