REGISTER STORAGE CLASS

The register storage class is used to store a variable in register instead of memory. it is hint to the compiler for optimization purpose indicating that the variable will be havialy  used and should be stored register for faster access.

Storage -> CPU register

Default initial value -> garbage value

Scope -> local to the block variable if defined

Life -> till the control remains with in the block in which variable is defined

Ex

#include<stdio.h>

int main(){

  register int i;

  for(i=0; i<=10; i++)

  printf(“%d”, i);

  return 0;

} 

Output:1 2 3 4 5 6 7 8 9 10