Correct option is C
In C, the
static storage class ensures that the variable is stored in memory only once and retains its value across multiple function calls. Static variables have
internal linkage by default, meaning they are accessible only within the file in which they are declared.
Important Key Points:
1.
Static variables are initialized only once and maintain their value between function calls.
2. Internal linkage ensures that the variable is restricted to the file it is declared in, preventing access from other files.
3. Example of a static variable:
Knowledge Booster:
·
auto: Default storage class for local variables. It has
automatic duration and
block scope, but no internal linkage.
·
register: Suggests that the variable be stored in a CPU register for faster access. It has no linkage and is local to the block.
·
extern: Used to declare global variables accessible across multiple files. It provides
external linkage.
·
typedef: Not a storage class but a keyword used to create type aliases, e.g., typedef unsigned int uint;.