What are Storage Classes in C ?

Answer Posted / sanath

Storage class determins the life time of the storage of an
identifier.
where the identifier is stored is determined by storage
class
Identifier means name given to a variable or a function.

There are 2 storage classes
1.Automatic storage class
2.static storage class

Automatic storage class
-----------------------
Variables declared within a function body are called
automatic variables.Auto is the keyword used to declare
automatic variables. By default and without the use of auto
keyword, the vaeiables inside the function are automatic
variables.auto matic variables are stored in stack.
Variables declared as register are also automatic they
are stored in fast registers of CPU.If sufficient number of
registers are not available, the register variables also
stored in stack.
When the function is calling these variables are
allocating memmory automatically. When the function is
finished and exits, the controll trnsfered to the calling
program the memory allocated will be destroyed.
2.Static storage class
-----------------------

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Multiply an Integer Number by 2 Without Using Multiplication Operator

308


Describe the modifier in c?

588


Sir i need notes for structure,functions,pointers in c language can you help me please

1933


What does nil mean in c?

663


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

748






a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1575


How #define works?

599


Why do we use stdio h and conio h?

621


Between macros and functions,which is better to use and why?

1559


What is the size of array float a(10)?

644


Differentiate between static and dynamic modeling.

605


Explain how do you list a file’s date and time?

607


Explain how can type-insensitive macros be created?

560


Explain what are header files and explain what are its uses in c programming?

617


Explain threaded binary trees?

664