关于C#:默认情况下全局变量是extern吗?

Are global variables by default extern? if yes, then why they have default value “ 0 ”?

我正在学习C语言,在这期间,我将面对全局变量和外部关键字。我在这个站点上读到它们(C中的全局变量是静态的还是非静态的),发现

Global variables are extern by default

但我知道全局变量的默认值是0。所以,我很困惑:怎么可能只有声明而没有定义带有extern关键字的变量呢?


布尔奇1

  • Global variables are externan by default-that means they can be used by other translation unit(can simply be other source files).
  • That said global variables are not automatically usable from other source files unless there are corresponding EDOCX1
  • True that the EDOCX1 penographic 0 communal keyword does not have any initialisation because it is declaration only.So the auto value(0)of global variables(from original source files)is obtained at the point of their own definition.
  • Note that there can only be one definition(in original source file),but as many EDOCX1 candible 0 napal declarations(on other source files).