How is a variable accessed from another file?
Reveal answer
Fill a bubble to check yourself
How is a variable accessed from another file?
The global variable is referenced via the extern specifier.
The global variable is referenced via the auto specifier.
The global variable is referenced via the global specifier.
The global variable is referenced via the pointer specifier.
The global variable is referenced via the ext specifier.
To access a global variable defined in another file, you must declare it with the extern specifier, which tells the compiler the variable exists elsewhere. The extern declaration doesn't allocate storage, it just references the existing definition. Option B is wrong because auto is for local variables. Option C and D are not valid specifiers. Option E uses an invalid specifier name.