This blog is under construction

Sunday, 13 May 2012

Storage classes in C

The scope and behavior of the variable depends on the type of storage class which is being used.  There are four types of storage classes available in C language.  They are as follows

     1. auto storage class
     2. static storage class
     3. extern storage class
     4. register storage class


auto variables:
Local variables in a function are auto variables.  Auto variables are active inside the block in which they are declared.

register variables:
Frequently used variables are declared as registers.  These register variables are stored in CPU registers for fast access.  This reduces the execution time of the program.

static variables:
Static variables retain their old values even after the execution of function or block is over.

extern variables:
Usually, extern variables are global variables and they are visible to all functions in one or more files.

Let us see more details on the above topics in the forthcoming tutorials.

1 comment:

  1. Dell Laptop Service center are giving repair service at the door. We should high quality Dell out of warranty Laptop Repair, removal of virus, screen removal, wireless network set up, battery removal, motherboard replacement to several other are offered at budget friendly price and it’s Negotiable. We can fix them all in time by our well experience and certified technicians. If you want to repair your laptop in front of your eyesight, than you may call us: 7217871051

    ReplyDelete