Storage Classes
Storage Classes
- A variable always have data type(int,float etc) but they also have a storage class or we can say a variable always need data type as well as storage class.
- As we had seen many examples before, but we did not use storage classes there, because variables also have default storage classes. So if we do not mention storage class, compiler will assume default.
- In computer we use two types of memory
1. Internal Memory
2. CPU Registers.
- It is the variable’s storage class that determines in which of these two locations the value is stored.
What is use of storage class?
- To know about life of variable
- To know about scope of variable
- To store variables in memory or registers
- To know initial value of variable, if we did not assign default value.
Types of Storage classes:
There are 4 types of storage class
This comment has been removed by a blog administrator.
ReplyDelete