Registers are faster than memory to access, so most frequently variables can be put in registers using register keyword. The keyword register hints to compiler that a given variable can be put in a register (It’s compiler’s choice to put or not).
Things to remember with register variable -
1) If you use & operator with a register variable then compiler may give an error or warning (Obviously if variable is stored in a register instead of memory and accessing address of a register is invalid).
2) There is no limit on number of register variables in a C program but it does not mean all will be put in register (compiler may put some variables in register and some not)
3) register keyword can be used with pointer variables. Obviously, a register can have address of a memory location.
4) Register is a storage class and register can not be used with static storage class.