Hi,
I need some help to understand storage classes in c language. I've been searching on internet and trying to understand uses of different storage classes. I have been read the this link https://en.wikiversity.org/wiki/C/Storage_Classes
Variable store at specific memory location and storage means space to store variable value in memory.
There are the four type of storage classes
register: this storage class specifier can be used to indicate to the compiler that the variable will be used frequently and it should be placed in a CPU register
static: this storage class specifier is used for local and global variable
extern: this storage class specifier is used to declare a variable or function that is defined in another module.
auto: this is the default storage class specifier for variables defined inside a function. auto can be used only inside functions
Can anyone help me with storage classes in c language. I don't understand why we need to specify storage classes. I am trying to understand what's the need of storage classes and What are the uses of different storage classes in program ?
I need some help to understand storage classes in c language. I've been searching on internet and trying to understand uses of different storage classes. I have been read the this link https://en.wikiversity.org/wiki/C/Storage_Classes
Variable store at specific memory location and storage means space to store variable value in memory.
There are the four type of storage classes
- Auto
- Register
- Extern
- Static
register: this storage class specifier can be used to indicate to the compiler that the variable will be used frequently and it should be placed in a CPU register
static: this storage class specifier is used for local and global variable
extern: this storage class specifier is used to declare a variable or function that is defined in another module.
auto: this is the default storage class specifier for variables defined inside a function. auto can be used only inside functions
Can anyone help me with storage classes in c language. I don't understand why we need to specify storage classes. I am trying to understand what's the need of storage classes and What are the uses of different storage classes in program ?