Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Tuesday, March 10, 2015

What is register storage class ?

It is a type of storage class. Register storage class variables are stored in CPU registers. The default initial value of register storage class variables is garbage values, unless they are initialized explicitly.
The scope of register storage class variables is local or blocks scope, and the life time of the variable, exists as long as control remains in the block. Register storage class variables are accessed faster than the other storage class because they use CPU register’s to store values.

#include<stdio.h>
#include<conio.h>
void main()
{
     register int a=10;
     {
           register int a=20;
           printf(“%d\n”,a);
     }
     printf(“%d”,a);
   }

Output:    20
           10


No comments:

Post a Comment