External linkage

C only

In global scope, identifiers for the following kinds of entities declared without the static storage class specifier have external linkage:

If an identifier in C is declared with the extern keyword and if a previous declaration of an object or function with the same identifier is visible, the identifier has the same linkage as the first declaration. For example, a variable or function that is first declared with the keyword static and later declared with the keyword extern has internal linkage. However, a variable or function that has no linkage and was later declared with a linkage specifier will have the linkage that was expressly specified.

End of C only
C++ only

In namespace scope, the identifiers for the following kinds of entities have external linkage:

If the identifier for a class has external linkage, then, in the implementation of that class, the identifiers for the following will also have external linkage:

End of C++ only


[ Top of Page | Previous Page | Next Page | Contents | Index ]