Storage classes - C Programming
- Automatic variables:
- A variable declared inside a function without any storage class specification.
- Created when a function is called and are destroyed automatically when the function exits.
- Default assigned garbage value by the compiler
- External or Global variable :
- declared outside any function
- remain available throughout the entire program
- values can be changed by any function in the program.
- extern keyword
- Static
- initialized only once
- assigned 0 (zero) as default value by the compiler
- Register variable
- store the variable in register instead of memory
- Only few variables can be placed inside register.
- can never get the address of such variables
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment