相关疑难解决方法(0)

String Literal address across translation units

I'd like to ask if is it portable to rely on string literal address across translation units? I.e:

A given file foo.c has a reference to a string literal "I'm a literal!", is it correct and portable to rely that in other given file, bar.c in instance, that the same string literal "I'm a literal!" will have the same memory address? Considering that each file will be translated to a individual .o file.

For better illustration, follows an …

c c++ string pooling string-literals

7
推荐指数
1
解决办法
846
查看次数

标签 统计

c ×1

c++ ×1

pooling ×1

string ×1

string-literals ×1