What are storage class in c

Questions by arshad_arshadkk

Showing Answers 1 - 9 of 9 Answers

skpmca

  • Feb 2nd, 2006
 

there r of 4 type of storage class in C

static

auto

register

extern

  Was this answer useful?  Yes

Zdharan

  • Feb 22nd, 2006
 

auto - its a local variable. Valid only within that fn. . garpage initial valuestatic - stored in permenent memory. Initial value 0. Valid for all fn.Register - stored in CPU register. Used for fast arithmatic operation. Limited no. of reg variables. When it exeeds it will take it as auto variable. Extern - Extern the variable access from one fn. to other fn.

  Was this answer useful?  Yes

variables in C may posses an attribute called storage class in addition to data type. A storage class controls  lifetime , scope and linkage of a variable.

there are five types of storage classes in C:

      storage class                lifetime                 scope               linkage

(1) auto                             within a block       block scope        NO

(2) register                         within block          local scope         NO

(3) static class

     (a) internal static           persistent             local                    NO

     (b) external                  persistent              file scope            internal linkage

(4) Extern                         persistent              file scope            internal/external

(5) Another storage class is typedef which is different from other storage classes and is  used for creating user defined data types. it does not create a new data type, but it only rename existing data type.

  Was this answer useful?  Yes

supriya

  • Mar 18th, 2006
 

hi,

1.auto

2.static

3.extern

4.register

5.volatile

  Was this answer useful?  Yes

paulson paul chambakottukudyil

  • Apr 17th, 2006
 

"volatile" seems to be strange for me. Can you explain please..........

  Was this answer useful?  Yes

Mahananda R.Biradar

  • May 12th, 2006
 

 Actually there are only two storage Classe........its given in K & R

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions