What is external linkage and internal linkage?

前端 未结 9 1203
情深已故
情深已故 2020-11-22 00:10

I want to understand the external linkage and internal linkage and their difference.

I also want to know the meaning of

const va

9条回答
  •  再見小時候
    2020-11-22 00:18

    Linkage determines whether identifiers that have identical names refer to the same object, function, or other entity, even if those identifiers appear in different translation units. The linkage of an identifier depends on how it was declared. There are three types of linkages:

    1. Internal linkage : identifiers can only be seen within a translation unit.
    2. External linkage : identifiers can be seen (and referred to) in other translation units.
    3. No linkage : identifiers can only be seen in the scope in which they are defined. Linkage does not affect scoping

    C++ only : You can also have linkage between C++ and non-C++ code fragments, which is called language linkage.

    Source :IBM Program Linkage

提交回复
热议问题