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

Explain what is the difference between functions getch() and getche()?

595


can we have joblib in a proc ?

1643


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1851


What are local variables c?

539


What is chain pointer in c?

591






Differentiate between new and malloc(), delete and free() ?

656


What is the easiest sorting method to use?

625


Are the variables argc and argv are local to main?

778


Do you know what are the properties of union in c?

569


Explain how do you view the path?

640


What does volatile do?

554


How can I do peek and poke in c?

608


How do you initialize pointer variables?

596


how to construct a simulator keeping the logical boolean gates in c

1714


What is static identifier?

691