Difference between 'global' and 'static global'

后端 未结 7 1300
野性不改
野性不改 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条回答
  •  Happy的楠姐
    2020-12-12 16:34

    Static globals cannot be accessed from other files while global variables can be accessed using the extern keyword.

提交回复
热议问题