More About Scope in Multi-File Programs
- Global variables declared with the extern specifier are
defined in
another file, usually the source file containing function
implementations
- Global extern variables, therefore, have program scope. An
extern variable can be accessed anywhere within any of the
program files
- Global variables declared with the static extern specifier
only have file scope i.e. they are accessible only within the
file in which they are declared
- Functions declared globally have program scope (they are
extern)
by default
Back to Previous Page
Document:
Local Date:
Last Modified On: