Variables and Storage Classes
auto
- default variable type
- local to a function
static
- retains the values between function calls
- initialized only once
- unavailable outside the scope of the function
extern
- extern keyword tells the compiler that a variable (or function) exists, even if the compiler has not seen it in the file currently being compiled
- forces external linkage
volatile
- volatile keyword prevents the compiler from performing any optimization based on the stability of that variable
- value of a volatile variable is always read whenever its value is required
register
- variables are accessed faster
- often placed in register
- address of a register variable cannot be taken or computed i.e. the unary address-of operator (&) cannot be used with register arrays
- register keyword cannot be used with arrays