A Little about the blog.....

This blog contains all the interview questions that i face during my interviews with various MNC's. I am trying to post the solutions for almost all the questions and i have covered few important topics which would be frequent topics in interviews. I hope the blog would be useful not only for the job aspirants but also to the one who tries to upgrade his/her knowledge in C and Embedded concepts......

please enter your mail address in the above mail address box to get the immediate updates of the new interview questions.....

Wednesday, November 9, 2011

Storage classes in C: tutorial by Trinadh

Generally in C language, when we are defining a variable we do mention its data type, but not the storage class.

but by default, for every variable declared, some storage class in assumed by the compiler.To fully define any variable, we need to mention its data type and its storage class.

There are 4 data types of storage classes in C language:

1. Auto (automatic: default storage class)
2. Static
3. Register
4. Extern

The storage class gives the following information about the variable

* Default Initial Value of the Variable as soon as it is defined.
* The location of the variable where it is created and stored.
* The scope of the variable till how far the variable is accessible.
* The life of variable till how long the memory created for variable is reserved.

The following table gives the detail information about various storage classes.

1 comment: