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
Do string constants represent numerical values?
Explain how many levels deep can include files be nested?
Explain what is the difference between a string and an array?
Explain what is operator promotion?
What do you mean by invalid pointer arithmetic?
What is the condition that is applied with ?: Operator?
What is difference between function overloading and operator overloading?
Explain continue keyword in c
Can we change the value of constant variable in c?
How do you do dynamic memory allocation in C applications?
Function calling procedures? and their differences? Why should one go for Call by Reference?
What is the best way of making my program efficient?
Are c and c++ the same?
What is call by value in c?
what is reason of your company position's in india no. 1.