Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Storage Classes in C - Types And Classification Languages Programming Tutorials

Storage Classes in C-A Storage Class defines the scope (visibility) and life time of variables and/or
functions within a C Program..Two types of storage classes are there in c as explained below
1. Auto
2. Static

Storage class specifiers are
1. Auto
2. Static
3. Extern
4. Register
Auto - Storage Class-Auto is automatic class. resides in stack.
auto is the default storage class for all local variables.
{
int Count;
auto int Month;
}

The example above defines two variables with the same storage class. auto can
only be used within functions, i.e. local variables.

Variable Function Structure Pointer in C
Programming - C Viva Questions
Function  in Embedded C
C Programming Basic Questions
Array in Embedded C
Arrays And Pointer in C

Register - Storage Class-Register is used to define local variables that should be stored in a register instead
of RAM. This means that the variable has a maximum size equal to the register size (usually one word) and cant have the unary '&' operator applied to it (as it does not have a memory location).Fast access but limited.Reside in CPU registers details.

CONTINUE READING »


This post first appeared on IngenuityDias, please read the originial post: here

Share the post

Storage Classes in C - Types And Classification Languages Programming Tutorials

×

Subscribe to Ingenuitydias

Get updates delivered right to your inbox!

Thank you for your subscription

×