What is external linkage and internal linkage?

前端 未结 9 1237
情深已故
情深已故 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:10

    When you write an implementation file (.cpp, .cxx, etc) your compiler generates a translation unit. This is the source file from your implementation plus all the headers you #included in it.

    Internal linkage refers to everything only in scope of a translation unit.

    External linkage refers to things that exist beyond a particular translation unit. In other words, accessible through the whole program, which is the combination of all translation units (or object files).

提交回复
热议问题