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

What is the function of multilevel pointer in c?

1139


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

1043


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1757


how should functions be apportioned among source files?

1167


What is enumerated data type in c?

1128


What is the difference between procedural and functional programming?

1136


What are the characteristics of arrays in c?

1103


Why structure is used in c?

1238


How can you find out how much memory is available?

1114


Is that possible to add pointers to each other?

1428


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2624


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

1322


Explain the use of 'auto' keyword

1171


What are the three constants used in c?

1043


How many bytes is a struct in c?

1216