Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are Storage Classes in C ?

Answer Posted / vijayalakshmi

There are four types of storage classes in c. It defines the
scope and lifetime of a variable or function.

1. auto - This is the default storage class. Auto can only
be used with in functions. i.e. only for local variables,
not for globals.

2. register - The variables declared using the register
storage class may stored in cpu registers instead of RAM.
Since it doesn't have a memory location, the '&' operator
for getting the address of the variable cannot be applied
(in C). This storage class cannot be used for global scope data.

3. static - This is the default storage class for global
variables. In case of local variable, it is initialized at
compile time and retains its value between the calls. By
default the static variables will be initialized to zero,
incase of pointer variable initialized to NULL.

4. extern - Defines the global variables that is visible to
all object modules. This type of variables cannot be
initialized, since it is pointing to a storage location,
where it is previously define.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you know then define #pragma?

1109


What is a lvalue

1085


i got 75% in all semester am i eligible for your company

2230


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

2261


What are global variables and how do you declare them?

1102


Can a pointer be volatile in c?

992


Differentiate between Macro and ordinary definition.

1384


Why we not create function inside function.

2196


Can we initialize extern variable in c?

1138


What does %c mean in c?

1097


What's the best way of making my program efficient?

1110


What are valid signatures for the Main function?

1238


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

1236


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1096


What is the difference between far and near ?

1197