An identifier that is declared more than once, whether in different scopes (in different files, for example) or in the same scope, may refer to the same variable or function. Identifiers must be "linked" in this way in order for a variable to be used "globally," across different source files, for example.
Each identifier has either external, internal, or no linkage. These three kinds of linkage have the following significance:
An identifier with external linkage represents the same object or function throughout the entire program, i. e., in all source files and libraries belonging to the program. The identifier is made known to the linker.
When a second declaration of the same identifier with external linkage occurs, the linker associates the identifier with the same object or function. A declaration of an existing external object is sometimes called a reference declaration.
Internal linkage
An identifier with internal linkage represents the same object or function within a given translation unit. The linker has no information about identifiers with internal linkage. Thus they remain "internal" to the translation unit.
No linkage
If an identifier has no linkage, then any further declaration using the identifier declares something new, such as a new variable or a new type.
The linkage of an identifier is determined by its storage class; that is, by the position of the declaration and any storage class specifier included in it. Only identifiers of variables and functions can have internal or external linkage. All other identifiers, and identifiers of variables with automatic storage class, have no linkage. Table 1-20 summarizes this information.
The form of external names (identifiers with external linkage) is subject to restrictions, depending on the linker implementation: some linkers only recognize the first eight characters of a name, and do not distinguish between upper- and lower-case letters.