Asked by Megan Southall on Mar 10, 2024

verifed

Verified

The purpose of the ____ storage class is to extend the scope of a global variable declared in one source code file into another source code file.

A) auto
B) static
C) extern
D) register

Storage Class

Defines the scope, visibility, and lifetime of variables or functions within a C program.

Global Variable

A variable that is defined in the global scope, accessible and modifiable by any part of the code, across different functions and files.

Extern

The extern keyword in C and C++ is used to declare a variable or function in another file, indicating that its definition will be found elsewhere.

  • Recognize the attributes and objectives of various classifications of storage classes, including auto, static, extern, and register.
  • Identify the differences and use-cases of local, global, static, register, and extern variables.
verifed

Verified Answer

HL
hannah levinMar 10, 2024
Final Answer :
C
Explanation :
The `extern` storage class is used to declare a global variable or function in another file, extending its visibility across different source files.