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
How can a program be made to print the name of a source file where an error occurs?
What does sizeof int return?
What are keywords in c with examples?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
code for replace tabs with equivalent number of blanks
What is the difference between test design and test case design?
What is console in c language?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
How do you list a file’s date and time?
What is the meaning of 2d in c?
Explain is it better to bitshift a value than to multiply by 2?
How variables are declared in c?
What is || operator and how does it function in a program?
What are the complete rules for header file searching?
Can true be a variable name in c?