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 / monika

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 ?    31 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does %2f mean in c?

1167


What is the use of pointers in C?

1033


what are the advantages of a macro over a function?

1108


Explain pointer. What are function pointers in C?

1027


What is #include cctype?

1084


What does it mean when a pointer is used in an if statement?

1068


Is it possible to initialize a variable at the time it was declared?

1190


When can a far pointer be used?

978


Between macros and functions,which is better to use and why?

2132


What are data structures in c and how to use them?

1113


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2355


What is string function in c?

952


Explain the use of #pragma exit?

1134


What is getch () for?

1165


a c code by using memory allocation for add ,multiply of sprase matrixes

2755