内部链接Internal Linkage

如果对象或函数的文件范围标识符声明包含 storage-class-specifier static,则该标识符具有内部链接。If the declaration of a file-scope identifier for an object or a function contains the storage-class-specifier static, the identifier has internal linkage. 否则,该标识符具有外部链接。Otherwise, the identifier has external linkage. 有关 storage-class-specifier 非终止符的讨论,请参阅存储类See Storage Classes for a discussion of the storage-class-specifier nonterminal.

在一个翻译单元内,带内部链接的标识符的每个实例均表示相同的标识符或函数。Within one translation unit, each instance of an identifier with internal linkage denotes the same identifier or function. 内部链接的标识符对于翻译单元是唯一的。Internally linked identifiers are unique to a translation unit.

请参阅See Also

使用 extern 指定链接Using extern to Specify Linkage