There are no items in your cart
Add More
Add More
Item Details | Price |
---|
by S P SHARMA SIR
Thu Feb 27, 2025
Storage classes in C define the scope, lifetime, Default Initial Value and visibility of variables and functions. There are four main storage classes in C:
Storage Class | Keyword | Scope | /Lifetime | Default Initial Value |
---|
Automatic | auto | Block | Until block exits | Garbage (undefined) |
Register | register | Block | Until block exits | Garbage (undefined) |
Static | static | File/Block | Program lifetime | Zero (if not initialized) |
External | extern | Global | Program lifetime | Zero (if not initialized) |
1. auto
(Automatic Storage Class)
auto
is the default for local variables, we rarely use it explicitly.register
(Register Storage Class)&
) of a register
variable.register
, as they optimize automatically.static
(Static Storage Class)4. extern
(External Storage Class)
S P SHARMA CLASSES