ONLINE LEARNING

c language

It's all about self learning.

C-STORAGE CLASSES

STORAGE CLASSES
16 August, 2023     

REGISTER STORAGE CLASSES:

1.Register variable inform the compiler to store the variable in register instead of memory.
2.This makes the use of register variables to be much faster than that of the variables stored in the memory during the run-time of the program. 
3.This means that the variable has a maximum size equal to the register size and can't have the unary '&' operator applied to it.
4.If a free register is not available, these are then stored in the memory only.

  #include<stdio.h>
int main()
{
 register int i;
 for(i=10; i>=0; i=i-2)
    printf("%d ",i);
 return 0;
}

OUTPUT:-

10 8 6 4 2 0
 
  

Get solution for your websites

logo