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
Explain what is the difference between functions getch() and getche()?
can we have joblib in a proc ?
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(); }
What are local variables c?
What is chain pointer in c?
Differentiate between new and malloc(), delete and free() ?
What is the easiest sorting method to use?
Are the variables argc and argv are local to main?
Do you know what are the properties of union in c?
Explain how do you view the path?
What does volatile do?
How can I do peek and poke in c?
How do you initialize pointer variables?
how to construct a simulator keeping the logical boolean gates in c
What is static identifier?