1.

What Are Storage Class In C?

Answer»

The scope and lifetime of a variable or / and function within a C program is defined by storage class. There are four storage CLASSES in C

auto - It is the default storage class for all variables and / or functions.

register - Allows for defining variables to store in CPU register instead of RAM. Unary operator is not applied for register variable.

static – The static storage class allows the updated variable values available for the NEXT time when the function, in which the variable is defined , is INVOKED for the next time.

EXTERN - It allows a GLOBAL variable to be visible to all the program files / external files ( C programs).

The scope and lifetime of a variable or / and function within a C program is defined by storage class. There are four storage classes in C

auto - It is the default storage class for all variables and / or functions.

register - Allows for defining variables to store in CPU register instead of RAM. Unary operator is not applied for register variable.

static – The static storage class allows the updated variable values available for the next time when the function, in which the variable is defined , is invoked for the next time.

extern - It allows a global variable to be visible to all the program files / external files ( C programs).



Discussion

No Comment Found