What are Storage Classes in C ?

Answer Posted / laxmikant

C supports 4 types of storage class. They are given
hereundr:-
1> Extern
2> static
3> Register
4> Auto
By default a variable defined inside a block is a auto
variable.It has block level scope.Regsiter storage class
indicates that the variable is stored in the CPU rather
than Memory. So the opeartion is faster because accessing
register is faster then memory.Extern indicates that the
effect of the variable is realised in every object modules.
And finally static .If it is defined inside the
function ,then it's retian its value during different
function call.And it's life is through out the program.And
it's initilized only once.

Is This Answer Correct ?    27 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to check prime number in c programming?

609


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5468


Is there any data type in c with variable size?

638


Write a code of a general series where the next element is the sum of last k terms.

598


What is memcpy() function?

626






What is sizeof int in c?

613


What is string in c language?

632


What is extern storage class in c?

523


How can you increase the size of a statically allocated array?

622


In which header file is the null macro defined?

863


What are the two forms of #include directive?

649


what is recursion in C

620


Why clrscr is used after variable declaration?

1049


What is the difference between malloc calloc and realloc in c?

655


Why do we use int main?

618