Without the use of the keyword static
, a global variable is
accessible by the linker. This means that such a variable can be
referenced by another source code. However, if a global variable
is defined with the keyword static
, it is only visible in the
local source file.
Personally, I think static
should be the default to limit
visibility of global variables. However, C/C++ exposes global variables
to other source files by default.