Skip to content

Commit d7d0406

Browse files
committed
modified: _posts/2018-02-09-avoid-global-variables.md
1 parent 5254406 commit d7d0406

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_posts/2018-02-09-avoid-global-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ undefined is not a function
6161

6262
[C++手稿:静态和全局变量的作用域](/2015/09/30/cpp-static-and-global.html)
6363
中探讨过 C++ 全局变量的初始化时序问题,
64-
大意是全局变量分散在众多的 output 文件中,它们链接到一起时谁也不知道这些全局变量的初始换顺序。
64+
大意是全局变量分散在众多的 .o 文件中,它们链接到一起时谁也不知道这些全局变量的初始换顺序。
6565
**全局变量间引用的结果就会变得不可预测**
6666

6767
初始化时序问题不是 C++ 特有的。只要有多个全局变量,它们之间的顺序就会很难保证。

0 commit comments

Comments
 (0)