Register storage class
- Physical storage space can be a variable that is the main storage. With access to the registers in the CPU is faster than main memory, a register variable to register the specified variable is the physical storage space of variables. However, they require that as much as possible to ensure the register, the register guarantee is not necessarily secure.
- Register variables are stored in the register of the microprocessor. The number of variable which can be declared register are limited. This means that the variable has a maximum size equal to the register size. If more variables are declared as register variable, they are treated as auto variables.
- A program that uses register variables executes faster as compared to similar program without register variable.
- To declare a variable register storage class register specified.
register int n;
C – REGISTER STORAGE CLASS EXAMPLE PROGRAM :
register int c;
printf(“Enter first number \n”);
printf(“Enter second number\n”)
printf(“The sum of %d and %d is %d ”,a,b,c);
|Enter first number
Enter second number
The sum of 10 and 20 is 30