Difference between 'global' and 'static global'

后端 未结 7 1314
野性不改
野性不改 2020-12-12 15:44

A global variable\'s scope is in all the files, while a static global variable\'s scope is just the file where it is declared. Why

7条回答
  •  心在旅途
    2020-12-12 16:18

    They're both stored in the data segment; the difference is that the global has an externally-visible linker symbol, and the static global does not.

提交回复
热议问题