J
j
Anyone here feel that "global variables" is misleading for variables
whose scope is file scope? "global" seems to imply global visibility,
while this isn't true for variables whose scope is file scope. If you
have a variable whose scope is file scope in another translation unit,
you have to provide a local declaration to access that variable from
the other translation unit.
Also, I don't see "global variable" used once in the standard. So
would it be more correct to refer to such variables that are often
referred to with the term "global variable" as just variables whose
scope is file scope?
whose scope is file scope? "global" seems to imply global visibility,
while this isn't true for variables whose scope is file scope. If you
have a variable whose scope is file scope in another translation unit,
you have to provide a local declaration to access that variable from
the other translation unit.
Also, I don't see "global variable" used once in the standard. So
would it be more correct to refer to such variables that are often
referred to with the term "global variable" as just variables whose
scope is file scope?