V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  lonewolfakela  ›  全部回复第 16 页 / 共 16 页
回复总数  302
1 ... 7  8  9  10  11  12  13  14  15  16  
2019-08-07 22:48:19 +08:00
回复了 codechaser 创建的主题 C++ c++访问其他源文件定义的数组
@codechaser
Appendix C (C++11, C.1.2)

“ Change: A name of file scope that is explicitly declared const, and not explicitly declared extern, has internal linkage, while in C it would have external linkage

Rationale: Because const objects can be used as compile-time values in C++, this feature urges programmers to provide explicit initializer values for each const. This feature allows the user to put const objects in header files that are included in many compilation units.”
2019-08-06 16:58:10 +08:00
回复了 codechaser 创建的主题 C++ c++访问其他源文件定义的数组
C++中的 const 附带 imply "internal linkage" ,大体上可以理解为 const 默认就是 const static。
1 ... 7  8  9  10  11  12  13  14  15  16  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2888 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms · UTC 03:21 · PVG 11:21 · LAX 20:21 · JFK 23:21
Developed with CodeLauncher
♥ Do have faith in what you're doing.