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
What is the difference between functions getch() and getche()?
Is c compiled or interpreted?
When is the “void” keyword used in a function?
What do you understand by friend-functions? How are they used?
What are structures and unions? State differencves between them.
What is pointer and structure in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Explain what is gets() function?
What are different types of variables in c?
What is the Purpose of 'extern' keyword in a function declaration?
What is the use of getchar() function?
a c code by using memory allocation for add ,multiply of sprase matrixes
How can I find out the size of a file, prior to reading it in?
Can a variable be both constant and volatile?
What is the purpose of sprintf() function?