What is storage class and what are storage variable ?

A storage class is an attribute that changes the behavior of a variable. It controls the lifetime, scope and linkage.There are five types of storage classes 1)auto   2)static   3)extern  4)register   5)typedef

Showing Answers 1 - 1 of 1 Answers

Storage class are used to define the lifetime and scope of a function or available.There are four storage classes namely auto,static,register and extern storage classes.
Storage variables are the variables which assigned to storage classes it determines the lifetime and scope.
Auto-lifetime is till the execution of program and scope is local to the function or program.
Static-lifetime is static and scope is internal to the unit for which it is created.
Register-variables are stored in faster access memory.
Extern-lifetime is static scope is global as it can be accessed anywhere in the entire program or outside a function.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions